samredai commented on code in PR #4717: URL: https://github.com/apache/iceberg/pull/4717#discussion_r872701045
########## python/src/iceberg/table/partitioning.py: ########## @@ -14,8 +14,13 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +from typing import Dict, Iterable, List, Tuple + +from iceberg.schema import Schema from iceberg.transforms import Transform +_PARTITION_DATA_ID_START: int = 1000 + class PartitionField: Review Comment: @dramaticlly that's an interesting idea I haven't thought of. A big argument for using the builder pattern was that we wanted `PartitionSpec` to be immutable, which would require us to include a ton of validation logic (everything that would be in a builder) in the `__init__` method. If I understand your suggestion, using `__post_init__` would allow us to have a typical init method, but then include the builder-type validation logic in the `__post_init__` which would fail the initialization of any invalid `PartitionSpec`. cc: @rdblue what do you think? -- 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]
