You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2023/01/24 18:30:53 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #6654: Python: Check if optional Parquet kv metadata is None before reading Iceberg Schema

Fokko commented on code in PR #6654:
URL: https://github.com/apache/iceberg/pull/6654#discussion_r1085731519


##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -505,7 +505,9 @@ def project_table(
         # Get the schema
         with fs.open_input_file(path) as fout:
             parquet_schema = pq.read_schema(fout)
-            schema_raw = parquet_schema.metadata.get(ICEBERG_SCHEMA)
+            schema_raw = None
+            if parquet_schema.metadata is not None:

Review Comment:
   You could also leverage the Walrus operator here:
   ```suggestion
               if metadata := parquet_schema.metadata:
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org