Skip to content

Commit ebac375

Browse files
author
octavia-squidington-iii
committed
Auto-fix lint and format issues
1 parent ad730cf commit ebac375

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

airbyte_cdk/sources/declarative/requesters/query_properties/properties_from_endpoint.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ def __post_init__(self, parameters: Mapping[str, Any]) -> None:
3333

3434
def get_properties_from_endpoint(self, stream_slice: Optional[StreamSlice]) -> List[str]:
3535
if self._cached_properties is None:
36-
self._cached_properties = list(map(self._get_property, self.retriever.read_records(records_schema={}, stream_slice=stream_slice))) # type: ignore # extracted will be a MutableMapping, given input data structure
36+
self._cached_properties = list(
37+
map(
38+
self._get_property,
39+
self.retriever.read_records(records_schema={}, stream_slice=stream_slice),
40+
)
41+
) # type: ignore # extracted will be a MutableMapping, given input data structure
3742
return self._cached_properties
3843

3944
def _get_property(self, property_obj: Mapping[str, Any]) -> str:
4045
path = [
4146
node.eval(self.config) if not isinstance(node, str) else node
4247
for node in self._property_field_path
4348
]
44-
return str(dpath.get(property_obj, path, default=[])) # type: ignore # extracted will be a MutableMapping, given input data structure
49+
return str(dpath.get(property_obj, path, default=[])) # type: ignore # extracted will be a MutableMapping, given input data structure

unit_tests/sources/declarative/requesters/query_properties/test_properties_from_endpoint.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def test_get_properties_from_endpoint():
4444
parameters={},
4545
)
4646

47-
properties = properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
47+
properties = properties_from_endpoint.get_properties_from_endpoint(
48+
stream_slice=StreamSlice(cursor_slice={}, partition={})
49+
)
4850

4951
assert len(properties) == 9
5052
assert properties == expected_properties
@@ -85,7 +87,9 @@ def test_get_properties_from_endpoint_with_multiple_field_paths():
8587
parameters={},
8688
)
8789

88-
properties = properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
90+
properties = properties_from_endpoint.get_properties_from_endpoint(
91+
stream_slice=StreamSlice(cursor_slice={}, partition={})
92+
)
8993

9094
assert len(properties) == 9
9195
assert properties == expected_properties
@@ -127,7 +131,9 @@ def test_get_properties_from_endpoint_with_interpolation():
127131
parameters={},
128132
)
129133

130-
properties = properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
134+
properties = properties_from_endpoint.get_properties_from_endpoint(
135+
stream_slice=StreamSlice(cursor_slice={}, partition={})
136+
)
131137

132138
assert len(properties) == 9
133139
assert properties == expected_properties
@@ -148,9 +154,15 @@ def test_given_multiple_calls_when_get_properties_from_endpoint_then_only_call_r
148154
parameters={},
149155
)
150156

151-
properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
152-
properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
153-
properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
157+
properties_from_endpoint.get_properties_from_endpoint(
158+
stream_slice=StreamSlice(cursor_slice={}, partition={})
159+
)
160+
properties_from_endpoint.get_properties_from_endpoint(
161+
stream_slice=StreamSlice(cursor_slice={}, partition={})
162+
)
163+
properties_from_endpoint.get_properties_from_endpoint(
164+
stream_slice=StreamSlice(cursor_slice={}, partition={})
165+
)
154166

155167
assert retriever.read_records.call_count == 1
156168

@@ -172,6 +184,8 @@ def test_given_value_is_int_when_get_properties_from_endpoint_then_return_str():
172184
parameters={},
173185
)
174186

175-
properties = properties_from_endpoint.get_properties_from_endpoint(stream_slice=StreamSlice(cursor_slice={}, partition={}))
187+
properties = properties_from_endpoint.get_properties_from_endpoint(
188+
stream_slice=StreamSlice(cursor_slice={}, partition={})
189+
)
176190

177191
assert properties == expected_properties

unit_tests/sources/declarative/requesters/query_properties/test_property_chunking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ def test_given_single_property_chunk_when_get_request_property_chunks_then_alway
125125
)
126126
)
127127

128-
assert property_fields == ["rick", "chelsea", "victoria", "tim", "saxon", "lochlan", "piper"]
128+
assert property_fields == ["rick", "chelsea", "victoria", "tim", "saxon", "lochlan", "piper"]

0 commit comments

Comments
 (0)