Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FormatOptions in Const Contexts #4580

Closed
tustvold opened this issue Jul 29, 2023 · 1 comment · Fixed by #4581
Closed

Use FormatOptions in Const Contexts #4580

tustvold opened this issue Jul 29, 2023 · 1 comment · Fixed by #4581
Assignees
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@tustvold
Copy link
Contributor

tustvold commented Jul 29, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I would like to be able to specify a default set of FormatOptions for use by datafusion-cli and its tests, it would be advantageous if this could be declared as a const.

Describe the solution you'd like

I would like to be able to write

const DEFAULT_FORMAT_OPTIONS: FormatOptions<'static> = FormatOptions::new()
        .with_date_format(Some("foo"))
        .with_timestamp_format(Some("404"));

By extension this will also allow declaring const CastOptions

Describe alternatives you've considered

Additional context

@tustvold tustvold added the enhancement Any new improvement worthy of a entry in the changelog label Jul 29, 2023
@tustvold tustvold self-assigned this Jul 29, 2023
tustvold added a commit to tustvold/arrow-rs that referenced this issue Jul 29, 2023
tustvold added a commit that referenced this issue Jul 30, 2023
* Make FormatOptions const (#4580)

* Add non-ISO duration display (#4554)

* Review feedback
@tustvold tustvold added the arrow Changes to the arrow crate label Jul 30, 2023
@tustvold
Copy link
Contributor Author

label_issue.py automatically added labels {'arrow'} from #4581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant