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

Configure timestamp downcast programmatically #960

Open
devinrsmith opened this issue Jul 24, 2024 · 1 comment
Open

Configure timestamp downcast programmatically #960

devinrsmith opened this issue Jul 24, 2024 · 1 comment
Assignees

Comments

@devinrsmith
Copy link

Feature Request / Improvement

During testing of 0.7.0rc1, I noticed timestamp downcast errors, introduced as part of #848.

I'd like to have a way to programmatically configure timestamp downcast in the python API without relying on environment variables or a yaml configuration file.

I would have assumed that something like

from pyiceberg.table import DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE

catalog = ...

table = catalog.create_table(
    ...
    properties={DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE: True},
)

or

from pyiceberg.table import DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE

catalog = load_catalog(
    ...,
    **{
        DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE: "True",
    }
)

would have been the proper way to configure it, but it doesn't seem to take in either case.

@sungwy
Copy link
Collaborator

sungwy commented Aug 1, 2024

Hi @devinrsmith thank you again for raising this suggestion. I'm working on a similar property driven feature in #986 where I'm proposing that we load the pyarrow file IO config property into the table property as you suggest in the bottom proposal

For example, it will look like:

from pyiceberg.io import PYARROW_DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE

catalog = load_catalog(
    ...,
    **{
        PYARROW_DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE: "True",
    }
)

When the proposed approach is accepted and merged, I will open a PR to suggest a similar configuration.

@sungwy sungwy self-assigned this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants