Fokko opened a new pull request, #5445:
URL: https://github.com/apache/iceberg/pull/5445
Instead of having an optional property. I think this is a nicer
API and it also removes the awkward `properties or {}` logic.
We can't use a {} in the constructor since that will always
reference the same object, and therefore is a source of weird bugs.
https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/
Next to that, we can also use the frozendict in the future when
we want to return immutable data: https://pypi.org/project/frozendict/
The frozendict is sometimes faster than the default impl:
https://github.com/Marco-Sulla/python-frozendict#benchmarks
Next to that, it is also hashable, which is also a nice property.
The package itself doesn't depend on anything, so we pull in very little
additional requirements.
I've added it into `typedef.py` which will also be introduced in:
https://github.com/apache/iceberg/pull/5360
I didn't want to create a new file for it, and also didn't find any
places where it could fit in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]