Skip to content

Commit ae05826

Browse files
committed
Run pre-commit on all files to fix linter issues
Signed-off-by: Deepyaman Datta <[email protected]>
1 parent 68d29bf commit ae05826

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ repos:
7272
hooks:
7373
- id: codespell
7474
additional_dependencies:
75-
- tomli
75+
- tomli

pandera/backends/ibis/components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, List, Optional, cast
5+
from typing import TYPE_CHECKING, Iterable, List, Optional, cast
66

77
import ibis
88
import ibis.selectors as s

pandera/backends/ibis/container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def check_column_presence(
298298
# regex pattern
299299
check_obj.select(s.matches(colname))
300300
continue
301-
except IbisError as err:
301+
except IbisError:
302302
# regex pattern didn't match any columns
303303
pass
304304
results.append(

pandera/engines/ibis_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DataType(dtypes.DataType):
2525
type: Any = dataclasses.field(repr=False, init=False)
2626
"""Native Ibis dtype boxed by the data type."""
2727

28-
def __init__(self, dtype: Any):
28+
def __init__(self, dtype: Optional[Any] = None):
2929
super().__init__()
3030
object.__setattr__(self, "type", ibis.dtype(dtype))
3131
dtype_cls = dtype if inspect.isclass(dtype) else dtype.__class__

tests/ibis/test_ibis_builtin_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ def pytest_generate_tests(self, metafunc):
13671367
)
13681368

13691369
def get_data_param(self):
1370-
"""Generate the params which will be used to test this function. All the accpetable
1370+
"""Generate the params which will be used to test this function. All the acceptable
13711371
data types would be tested"""
13721372
return {
13731373
"test_unique_values_eq_check": [

tests/ibis/test_ibis_container.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def test_basic_ibis_table_check_error(
114114
assert validated_df.equals(t_basic.execute())
115115

116116

117-
@pytest.mark.xfail(reason="`coerce_dtype` parser not yet implemented for Ibis backend")
117+
@pytest.mark.xfail(
118+
reason="`coerce_dtype` parser not yet implemented for Ibis backend"
119+
)
118120
def test_coerce_column_dtype(t_basic, t_schema_basic):
119121
"""Test coerce dtype via column-level dtype specification."""
120122
t_schema_basic._coerce = True
@@ -226,11 +228,11 @@ def custom_check(data: IbisData):
226228
],
227229
)
228230
def test_regex_selector(
229-
transform_fn,
230-
exception_msg,
231+
transform_fn, # pylint: disable=unused-argument
232+
exception_msg, # pylint: disable=unused-argument
231233
t_for_regex_match: ibis.Table,
232234
t_schema_with_regex_name: DataFrameSchema,
233-
t_schema_with_regex_option: DataFrameSchema,
235+
t_schema_with_regex_option: DataFrameSchema, # pylint: disable=unused-argument
234236
):
235237
for schema in (
236238
t_schema_with_regex_name,

tests/polars/test_polars_typing.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def test_to_format_parquet_direct(self):
543543
buffer = io.BytesIO()
544544
# Just check that the method exists and doesn't raise errors
545545
assert hasattr(df, "write_parquet")
546-
except (IOError, ValueError, AssertionError) as e:
546+
except (OSError, ValueError, AssertionError) as e:
547547
pytest.fail(f"Parquet buffer creation failed: {e}")
548548

549549
def test_to_format_feather_direct(self):
@@ -571,7 +571,7 @@ def test_to_format_feather_direct(self):
571571
buffer = io.BytesIO()
572572
# Just check that the method exists and doesn't raise errors
573573
assert hasattr(df, "write_ipc")
574-
except (IOError, ValueError, AssertionError) as e:
574+
except (OSError, ValueError, AssertionError) as e:
575575
pytest.fail(f"Feather buffer creation failed: {e}")
576576

577577
def test_to_format_unsupported(self):
@@ -685,7 +685,7 @@ def write_to_string_io(buffer):
685685
string_io.seek(0)
686686
result = string_io.getvalue()
687687
assert result == "string data"
688-
except (IOError, ValueError) as e:
688+
except (OSError, ValueError) as e:
689689
pytest.fail(f"StringIO buffer test failed: {e}")
690690

691691
# Test BytesIO handling (covers parquet and feather formats)
@@ -701,7 +701,7 @@ def write_to_bytes_io(buffer):
701701
bytes_io.seek(0)
702702
result = bytes_io.read()
703703
assert result == b"bytes data"
704-
except (IOError, ValueError) as e:
704+
except (OSError, ValueError) as e:
705705
pytest.fail(f"BytesIO buffer test failed: {e}")
706706

707707
def test_direct_write_to_buffer(self):
@@ -720,7 +720,7 @@ def write_to_buffer(buffer_type, write_func, error_prefix):
720720
return "string_result"
721721
else:
722722
return buffer
723-
except (IOError, ValueError, RuntimeError) as exc:
723+
except (OSError, ValueError, RuntimeError) as exc:
724724
raise ValueError(f"{error_prefix}: {exc}") from exc
725725

726726
# Test StringIO success path
@@ -761,7 +761,7 @@ def test_buffer(buffer):
761761
return "string result"
762762
else:
763763
return buffer
764-
except (IOError, ValueError, RuntimeError) as exc:
764+
except (OSError, ValueError, RuntimeError) as exc:
765765
raise ValueError("Buffer operation failed") from exc
766766

767767
# Test successful case with StringIO
@@ -777,7 +777,7 @@ def test_buffer(buffer):
777777
def test_error():
778778
try:
779779
raise RuntimeError("Test error")
780-
except (RuntimeError, ValueError, IOError) as exc:
780+
except (RuntimeError, ValueError, OSError) as exc:
781781
raise ValueError("Error prefix: Test error") from exc
782782

783783
with pytest.raises(ValueError, match="Error prefix: Test error"):

0 commit comments

Comments
 (0)