Skip to content

Commit 63a22d9

Browse files
committed
lint fixes
Signed-off-by: Calvin Hopkins <[email protected]>
1 parent c1e869e commit 63a22d9

File tree

2 files changed

+31
-46
lines changed

2 files changed

+31
-46
lines changed

sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,10 @@ def __hash__(self):
191191

192192
def __eq__(self, other):
193193
if not isinstance(other, SparkSource):
194-
raise TypeError("Comparisons should only involve SparkSource class objects.")
195-
return (
196-
super().__eq__(other)
197-
and self.spark_options == other.spark_options
198-
)
194+
raise TypeError(
195+
"Comparisons should only involve SparkSource class objects."
196+
)
197+
return super().__eq__(other) and self.spark_options == other.spark_options
199198

200199

201200
class SparkOptions:
@@ -296,7 +295,9 @@ def to_proto(self) -> DataSourceProto.SparkOptions:
296295

297296
def __eq__(self, other: object) -> bool:
298297
if not isinstance(other, SparkOptions):
299-
raise TypeError("Comparisons should only involve SparkOptions class objects.")
298+
raise TypeError(
299+
"Comparisons should only involve SparkOptions class objects."
300+
)
300301

301302
return (
302303
self.table == other.table

sdk/python/tests/unit/test_data_sources.py

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
)
1111
from feast.field import Field
1212
from feast.infra.offline_stores.bigquery_source import BigQuerySource
13+
from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import (
14+
SparkSource,
15+
)
1316
from feast.infra.offline_stores.file_source import FileSource
1417
from feast.infra.offline_stores.redshift_source import RedshiftSource
1518
from feast.infra.offline_stores.snowflake_source import SnowflakeSource
16-
from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import SparkSource
1719
from feast.types import Bool, Float32, Int64
1820

1921

@@ -235,52 +237,34 @@ def test_redshift_fully_qualified_table_name(source_kwargs, expected_name):
235237

236238
assert redshift_source.redshift_options.fully_qualified_table_name == expected_name
237239

240+
238241
@pytest.mark.parameterize(
239-
"test_data,are_equal",
240-
[
241-
(
242-
SparkSource(
243-
name='name',
244-
table='table',
245-
query='query',
246-
file_format='file_format'
247-
),
248-
True
249-
),
250-
(
251-
SparkSource(
252-
table='table',
253-
query='query',
254-
file_format='file_format'
255-
),
256-
False
242+
"test_data,are_equal",
243+
[
244+
(
245+
SparkSource(
246+
name="name", table="table", query="query", file_format="file_format"
257247
),
258-
(
259-
SparkSource(
260-
name='name',
261-
table='table',
262-
query='query',
263-
file_format='file_format1'
264-
),
265-
False
248+
True,
249+
),
250+
(SparkSource(table="table", query="query", file_format="file_format"), False),
251+
(
252+
SparkSource(
253+
name="name", table="table", query="query", file_format="file_format1"
266254
),
267-
(
268-
SparkSource(
269-
name='name',
270-
table='table',
271-
query='query1',
272-
file_format='file_format'
273-
),
274-
True
255+
False,
256+
),
257+
(
258+
SparkSource(
259+
name="name", table="table", query="query1", file_format="file_format"
275260
),
276-
]
261+
True,
262+
),
263+
],
277264
)
278265
def test_spark_source_equality(test_data, are_equal):
279266
default = SparkSource(
280-
name='name',
281-
table='table1',
282-
query='query',
283-
file_format='file_format'
267+
name="name", table="table1", query="query", file_format="file_format"
284268
)
285269
if are_equal:
286270
assert default == test_data

0 commit comments

Comments
 (0)