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

Set properties boolean value to lowercase string #919

Closed
kevinjqliu opened this issue Jul 12, 2024 · 4 comments
Closed

Set properties boolean value to lowercase string #919

kevinjqliu opened this issue Jul 12, 2024 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@kevinjqliu
Copy link
Contributor

Apache Iceberg version

None

Please describe the bug 🐞

Issue

As shown in #895, setting a property to python's boolean value (True/False) will end up saving the boolean value as the string value "True"/"False". This is because the property dictionary's values are converted to string by transform_dict_value_to_str implemented in #504.
So True -> "True"

Fix

I can see this as a common footgun. Let's add a fix so that any boolean in the properties dictionary values are converted to its lowercase string.

Example

As a concrete example:

catalog.create_table(
    "default.example",
    schema=Schema(
        NestedField(1, "created_at", TimestampType(), required=True)
    ),
    properties={"write.parquet.bloom-filter-enabled.column.material_id": True},
)

Will set the property as

{"write.parquet.bloom-filter-enabled.column.material_id": "True"}

But the expected value should be

{"write.parquet.bloom-filter-enabled.column.material_id": "true"}
@soumya-ghosh
Copy link
Contributor

@kevinjqliu could I pick this up?

@Fokko
Copy link
Contributor

Fokko commented Jul 12, 2024

@soumya-ghosh assigned it to you 👍

@soumya-ghosh
Copy link
Contributor

@Fokko @kevinjqliu PR #924 is ready for review.

@kevinjqliu
Copy link
Contributor Author

Resolved in #924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants