MehulBatra commented on PR #249: URL: https://github.com/apache/iceberg-python/pull/249#issuecomment-1875156254
Tested Locally all three seems to be passing ``` class DummyClass: def __init__(self, metadata): self.metadata = metadata def test_snapshot_id_condition(): import unittest class TestMyClass(unittest.TestCase): def test_snapshot_id_truthy(self): instance = DummyClass(metadata={'current_snapshot_id': 42}) self.assertTrue((snapshot_id := instance.metadata.get('current_snapshot_id')) is not None or isinstance(snapshot_id, int)) def test_snapshot_id_falsy(self): instance = DummyClass(metadata={'current_snapshot_id': None}) self.assertFalse((snapshot_id := instance.metadata.get('current_snapshot_id')) is not None or isinstance(snapshot_id, int)) def test_snapshot_id_zero(self): instance = DummyClass(metadata={'current_snapshot_id': 0}) self.assertTrue((snapshot_id := instance.metadata.get('current_snapshot_id')) is not None or isinstance(snapshot_id, int)) return unittest.TestLoader().loadTestsFromTestCase(TestMyClass) if __name__ == '__main__': unittest.TextTestRunner().run(test_snapshot_id_condition()) ``` <img width="692" alt="image" src="https://github.com/apache/iceberg-python/assets/66407733/eb36d997-1b03-44be-9004-ba8dc8d6d4da"> -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org