Skip to content

Commit

Permalink
chore: docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperHG90 committed Oct 20, 2024
1 parent 573c62f commit 6de060e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/dagster_pyiceberg/src/dagster_pyiceberg/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def update_table_spec(self, table: table.Table):
and self.number_of_table_spec_changes > 0
):
raise ValueError(
"Schema update mode is set to 'error' but there are schema changes to the Iceberg table"
"Partition spec update mode is set to 'error' but there are partition spec changes to the Iceberg table"
)
# If there are no changes, do nothing
elif self.number_of_table_spec_changes == 0:
Expand Down Expand Up @@ -505,12 +505,6 @@ def _table_writer(
else:
row_filter = iceberg_table.ALWAYS_TRUE

# An overwrite may produce zero or more snapshots based on the operation:

# DELETE: In case existing Parquet files can be dropped completely.
# REPLACE: In case existing Parquet files need to be rewritten.
# APPEND: In case new data is being inserted into the table.

# TODO: use some sort of retry mechanism here
# See: https://github.com/apache/iceberg-python/pull/330
# See: https://github.com/apache/iceberg-python/issues/269
Expand Down Expand Up @@ -548,6 +542,11 @@ def _overwrite_table_with_retries(
with retry:
try:
with table.transaction() as tx:
# An overwrite may produce zero or more snapshots based on the operation:

# DELETE: In case existing Parquet files can be dropped completely.
# REPLACE: In case existing Parquet files need to be rewritten.
# APPEND: In case new data is being inserted into the table.
tx.overwrite(df=df, overwrite_filter=overwrite_filter)
tx.commit_transaction()
except CommitFailedException:
Expand Down

0 comments on commit 6de060e

Please sign in to comment.