kevinjqliu commented on code in PR #3441:
URL: https://github.com/apache/iceberg-python/pull/3441#discussion_r4001130586
##########
pyiceberg/table/snapshots.py:
##########
@@ -413,6 +410,11 @@ def _update_totals(total_property: str, added_property:
str, removed_property: s
removed_property=REMOVED_EQUALITY_DELETES,
)
+ if context := EnvironmentContext.get():
+ # Defensively select only engine fields so future context additions
cannot overwrite snapshot metadata.
+ summary["engine-name"] = context["engine-name"]
+ summary["engine-version"] = context["engine-version"]
Review Comment:
i think this is the best because we dont want to accidentally allow
`EnvironmentContext` override other summary
##########
tests/conftest.py:
##########
@@ -103,14 +104,28 @@
from pyiceberg.io.pyarrow import PyArrowFileIO
-# Markers for suites that run separately from the unit tests
-NON_UNIT_TEST_MARKERS = {"integration", "s3", "adls", "gcs", "notebook",
"benchmark"}
+
+_original_environment_context_get = EnvironmentContext.get
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
for item in items:
- if not any(marker.name in NON_UNIT_TEST_MARKERS for marker in
item.iter_markers()):
- item.add_marker("unit")
+ if not any(item.iter_markers()):
+ item.add_marker("unmarked")
+
+
[email protected](autouse=True, scope="session")
+def _disable_environment_context() -> Generator[None, None, None]:
Review Comment:
this allows us to not make a lot of changes to existing tests
--
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]