Conversation
db7ee00 to
efc8d31
Compare
samredai
left a comment
There was a problem hiding this comment.
Overall this looks good, I suggested a few changes. Also I'm wondering if this should go into the table sub-module, I was thinking table/partition.py.
| from iceberg.transforms import Transform | ||
|
|
||
|
|
||
| class PartitionField: |
There was a problem hiding this comment.
@rdblue do we need to define a hash method for this class? Maybe something like:
def __hash__(self):
return hash((self.source_id, self.field_id, self.name, self.transform))There was a problem hiding this comment.
Looks like it's mainly used in list or object array from what I can tell, but please let me know if I should add it!
There was a problem hiding this comment.
Not sure the policy for adding hash across python classes, but maybe it will be useful as PartitionField is part of Iceberg public api ,(example if a user tries to make dicts keyed by partitionSpec?) Java version has it, for comparison.
There was a problem hiding this comment.
Sorry I was late to see this, but we don't need __hash__ implementations unless the objects are being used for keys in dicts.
|
@samredai added hash and moved |
|
Looks great. Thanks, @dramaticlly! |
This is 1st step of reintroduce #3228
adds
PartitionFieldiniceberg/partitioning.pyPurposefully keep the change list small to focus only on PartitionField and once checked in we can look into PartitionSpec next.
CC @samredai @rdblue @jun-he