Skip to content

Set properties boolean value to lowercase string #919

Closed
@kevinjqliu

Description

@kevinjqliu

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"}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions