You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/04/05 23:15:29 UTC
[iceberg] branch master updated: Python (legacy): Fix typos (#4203)
This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 11b3a9f9c Python (legacy): Fix typos (#4203)
11b3a9f9c is described below
commit 11b3a9f9c5bfccf477fda515a8d952e32a5e0ce2
Author: happyprg <ho...@gmail.com>
AuthorDate: Wed Apr 6 08:15:23 2022 +0900
Python (legacy): Fix typos (#4203)
Co-authored-by: jeehong.lee@navercorp.com <je...@navercorp.com>
---
python_legacy/iceberg/core/base_transaction.py | 1 +
python_legacy/tests/api/expressions/test_predicate_binding.py | 2 +-
python_legacy/tests/api/test_conversions.py | 8 ++++----
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/python_legacy/iceberg/core/base_transaction.py b/python_legacy/iceberg/core/base_transaction.py
index 19616f3b7..1c9bfdef7 100644
--- a/python_legacy/iceberg/core/base_transaction.py
+++ b/python_legacy/iceberg/core/base_transaction.py
@@ -60,6 +60,7 @@ class BaseTransaction(Transaction):
def table(self):
return self.transaction_table
+ # NOTE: function name has typo in the word `comitted`. Kept for backwards compatability in legacy python API.
def check_last_operation_commited(self, operation):
if self.last_base == self.current:
raise RuntimeError("Cannot create new %s: last operation has not committed" % operation)
diff --git a/python_legacy/tests/api/expressions/test_predicate_binding.py b/python_legacy/tests/api/expressions/test_predicate_binding.py
index 7b7e4beaf..4f0eecd4f 100644
--- a/python_legacy/tests/api/expressions/test_predicate_binding.py
+++ b/python_legacy/tests/api/expressions/test_predicate_binding.py
@@ -64,7 +64,7 @@ def test_comparison_predicate_binding(op, assert_and_unwrap):
assert op == bound.op
-def test_literal_converison(op, assert_and_unwrap):
+def test_literal_conversion(op, assert_and_unwrap):
struct = StructType.of([NestedField.required(15, "d", DecimalType.of(9, 2))])
unbound = UnboundPredicate(op, Expressions.ref("d"), "12.40")
bound = assert_and_unwrap(unbound.bind(struct))
diff --git a/python_legacy/tests/api/test_conversions.py b/python_legacy/tests/api/test_conversions.py
index fee617b54..b64f2d10b 100644
--- a/python_legacy/tests/api/test_conversions.py
+++ b/python_legacy/tests/api/test_conversions.py
@@ -235,7 +235,7 @@ class TestConversions(unittest.TestCase):
bytes([11]),
Literal.of(0.011).to(DecimalType.of(10, 3)).to_byte_buffer())
- def assertConversion(self, value, type, expectedBinary):
- byteBuffer = Conversions.to_byte_buffer(type.type_id, value)
- self.assertEqual(expectedBinary, byteBuffer)
- self.assertEqual(value, Conversions.from_byte_buffer(type, byteBuffer))
+ def assertConversion(self, value, type, expected_binary):
+ byte_buffer = Conversions.to_byte_buffer(type.type_id, value)
+ self.assertEqual(expected_binary, byte_buffer)
+ self.assertEqual(value, Conversions.from_byte_buffer(type, byte_buffer))