Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ repos:
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
hooks:
- id: flake8
args: [ "--ignore=E501,W503" ]
6 changes: 3 additions & 3 deletions python/tests/expressions/test_expressions_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ def test_accessor_base_class(foo_struct):
assert base.Accessor(position=6).get(foo_struct) == 1.234
assert base.Accessor(position=7).get(foo_struct) == Decimal("1.234")
assert base.Accessor(position=8).get(foo_struct) == uuid_value
assert base.Accessor(position=9).get(foo_struct) == True
assert base.Accessor(position=10).get(foo_struct) == False
assert base.Accessor(position=9).get(foo_struct) is True
assert base.Accessor(position=10).get(foo_struct) is False
assert base.Accessor(position=11).get(foo_struct) == b"\x19\x04\x9e?"


Expand Down Expand Up @@ -317,7 +317,7 @@ def test_bound_reference(table_schema_simple, foo_struct):

assert bound_ref1.eval(foo_struct) == "foovalue"
assert bound_ref2.eval(foo_struct) == 123
assert bound_ref3.eval(foo_struct) == True
assert bound_ref3.eval(foo_struct) is True


def test_boolean_expression_visitor():
Expand Down
2 changes: 1 addition & 1 deletion python/tests/io/test_io_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def test_raise_file_not_found_error_for_fileio_delete(CustomFileIO):
with pytest.raises(FileNotFoundError) as exc_info:
file_io.delete(output_file_location)

assert (f"Cannot delete file") in str(exc_info.value)
assert "Cannot delete file" in str(exc_info.value)

# Confirm that the file no longer exists
assert not os.path.exists(output_file_location)
Expand Down
4 changes: 2 additions & 2 deletions python/tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_partition_to_py(primitive_type, value_str, expected_result):
)
def test_none_partition_values(primitive_type):
"""Test converting a partition value to a python built-in"""
assert conversions.partition_to_py(primitive_type, None) == None
assert conversions.partition_to_py(primitive_type, None) is None


@pytest.mark.parametrize(
Expand All @@ -203,7 +203,7 @@ def test_none_partition_values(primitive_type):
)
def test_hive_default_partition_values(primitive_type):
"""Test converting a partition value to a python built-in"""
assert conversions.partition_to_py(primitive_type, "__HIVE_DEFAULT_PARTITION__") == None
assert conversions.partition_to_py(primitive_type, "__HIVE_DEFAULT_PARTITION__") is None


@pytest.mark.parametrize(
Expand Down
6 changes: 3 additions & 3 deletions python/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,19 @@ def test_schema_find_field_by_id(table_schema_simple):
assert isinstance(column1, NestedField)
assert column1.field_id == 1
assert column1.field_type == StringType()
assert column1.required == False
assert column1.required is False

column2 = index[2]
assert isinstance(column2, NestedField)
assert column2.field_id == 2
assert column2.field_type == IntegerType()
assert column2.required == True
assert column2.required is True

column3 = index[3]
assert isinstance(column3, NestedField)
assert column3.field_id == 3
assert column3.field_type == BooleanType()
assert column3.required == False
assert column3.required is False


def test_schema_find_field_by_id_raise_on_unknown_field(table_schema_simple):
Expand Down