Skip to content

Commit d4477ac

Browse files
committed
[change] lets use consistent naming in FS (execute_async())
1 parent 0a72ae8 commit d4477ac

10 files changed

Lines changed: 62 additions & 51 deletions

File tree

pyatlan/cache/aio/connection_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def lookup_by_guid(self, guid: str) -> None:
9999
.where(Term.with_state("ACTIVE"))
100100
.where(Term.with_super_type_names("Asset"))
101101
.where(Connection.GUID.eq(guid))
102-
.aexecute(self.client)
102+
.execute_async(self.client)
103103
)
104104
candidate = (response.current_page() and response.current_page()[0]) or None
105105
if candidate and isinstance(candidate, Connection):
@@ -114,7 +114,7 @@ async def lookup_by_qualified_name(self, connection_qn: str) -> None:
114114
.where(Term.with_state("ACTIVE"))
115115
.where(Term.with_super_type_names("Asset"))
116116
.where(Connection.QUALIFIED_NAME.eq(connection_qn))
117-
.aexecute(self.client)
117+
.execute_async(self.client)
118118
)
119119
candidate = (response.current_page() and response.current_page()[0]) or None
120120
if candidate and isinstance(candidate, Connection):

pyatlan/cache/aio/source_tag_cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def lookup_by_guid(self, guid: str) -> None:
9898
.where(Term.with_state("ACTIVE"))
9999
.where(Asset.SUPER_TYPE_NAMES.eq(Tag.__name__))
100100
.where(Asset.GUID.eq(guid))
101-
.aexecute(self.client)
101+
.execute_async(self.client)
102102
)
103103
candidate = (response.current_page() and response.current_page()[0]) or None
104104
# NOTE: Checking if the first result is an "Asset" since in pyatlan,
@@ -116,7 +116,7 @@ async def lookup_by_qualified_name(self, source_tag_qn: str) -> None:
116116
.where(Term.with_state("ACTIVE"))
117117
.where(Asset.SUPER_TYPE_NAMES.eq(Tag.__name__))
118118
.where(Asset.QUALIFIED_NAME.eq(source_tag_qn))
119-
.aexecute(self.client)
119+
.execute_async(self.client)
120120
)
121121
candidate = (response.current_page() and response.current_page()[0]) or None
122122
# NOTE: Checking if the first result is an "Asset" since in pyatlan,
@@ -141,7 +141,7 @@ async def lookup_by_name(self, stn: AsyncSourceTagName) -> None:
141141
.where(Term.with_state("ACTIVE"))
142142
.where(Asset.SUPER_TYPE_NAMES.eq(Tag.__name__))
143143
.where(Asset.QUALIFIED_NAME.eq(source_tag_qn))
144-
.aexecute(self.client)
144+
.execute_async(self.client)
145145
)
146146
candidate = (response.current_page() and response.current_page()[0]) or None
147147
# NOTE: Checking if the first result is an "Asset" since in pyatlan,

pyatlan/client/aio/asset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async def get_by_qualified_name(
249249
normalized_attributes,
250250
normalized_related_attributes,
251251
)
252-
results = await search.aexecute(client=self._client) # type: ignore[arg-type]
252+
results = await search.execute_async(client=self._client) # type: ignore[arg-type]
253253
return GetByQualifiedName.process_fluent_search_response(
254254
results, qualified_name, asset_type
255255
)
@@ -300,7 +300,7 @@ async def get_by_guid(
300300
search = GetByGuid.prepare_fluent_search_request(
301301
guid, asset_type, normalized_attributes, normalized_related_attributes
302302
)
303-
results = await search.aexecute(client=self._client) # type: ignore[arg-type]
303+
results = await search.execute_async(client=self._client) # type: ignore[arg-type]
304304
return GetByGuid.process_fluent_search_response(results, guid, asset_type)
305305

306306
# Use direct API call for simple requests
@@ -1299,7 +1299,7 @@ async def _manage_terms(
12991299
asset_type, qualified_name
13001300
)
13011301

1302-
results = await search_query.aexecute(client=self._client) # type: ignore[arg-type]
1302+
results = await search_query.execute_async(client=self._client) # type: ignore[arg-type]
13031303

13041304
# Validate search results using shared logic
13051305
first_result = ManageTerms.validate_search_results(

pyatlan/client/aio/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async def flush(self) -> Optional[AssetMutationResponse]:
223223
)
224224
results = await search.page_size(
225225
max(self._max_size * 2, DSL.__fields__.get("size").default) # type: ignore[union-attr]
226-
).aexecute(client=self._client) # type: ignore[arg-type]
226+
).execute_async(client=self._client) # type: ignore[arg-type]
227227

228228
async for asset in results:
229229
asset_id = AssetIdentity(

pyatlan/model/fluent_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ async def tagged_with_value_async(
273273
await FluentSearch()
274274
.select()
275275
.where(Tag.MAPPED_CLASSIFICATION_NAME.eq(tag_id))
276-
.aexecute(client=client)
276+
.execute_async(client=client)
277277
)
278278
]
279279
if len(synced_tags) > 1 and source_tag_qualified_name is None:
@@ -650,9 +650,9 @@ def execute(self, client: AtlanClient, bulk: bool = False) -> IndexSearchResults
650650
"""
651651
return client.asset.search(criteria=self.to_request(), bulk=bulk)
652652

653-
async def aexecute(
653+
async def execute_async(
654654
self, client: AsyncAtlanClient, bulk: bool = False
655-
) -> "AsyncIndexSearchResults":
655+
) -> AsyncIndexSearchResults:
656656
"""
657657
Run the fluent search asynchronously to retrieve assets that match the supplied criteria.
658658
`Note:` if the number of results exceeds the predefined threshold

tests/integration/aio/test_asset_batch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ async def test_batch_update(
242242
.where(Asset.TYPE_NAME.eq(View.__name__))
243243
.where(Asset.QUALIFIED_NAME.eq(view.qualified_name))
244244
.include_on_results(Asset.USER_DESCRIPTION)
245-
.aexecute(client=client)
245+
.execute_async(client=client)
246246
)
247247
assert results and results.count == 1
248248
assert results.current_page() and len(results.current_page()) == 1
@@ -280,7 +280,7 @@ async def test_batch_update(
280280
.where(Asset.TYPE_NAME.eq(MaterialisedView.__name__))
281281
.where(Asset.QUALIFIED_NAME.eq(mview.qualified_name))
282282
.include_on_results(Asset.USER_DESCRIPTION)
283-
.aexecute(client=client)
283+
.execute_async(client=client)
284284
)
285285
assert results and results.count == 1
286286
assert results.current_page() and len(results.current_page()) == 1
@@ -339,7 +339,7 @@ async def test_batch_update(
339339
.where(Asset.TYPE_NAME.eq(Table.__name__))
340340
.where(Asset.QUALIFIED_NAME.eq(view.qualified_name))
341341
.include_on_results(Asset.USER_DESCRIPTION)
342-
.aexecute(client=client)
342+
.execute_async(client=client)
343343
)
344344

345345
assert results and results.count == 1
@@ -394,7 +394,7 @@ async def test_batch_update(
394394
.where(Asset.TYPE_NAME.eq(Table.__name__))
395395
.where(Asset.QUALIFIED_NAME.eq(table1.qualified_name))
396396
.include_on_results(Asset.USER_DESCRIPTION)
397-
.aexecute(client=client)
397+
.execute_async(client=client)
398398
)
399399

400400
assert results and results.count == 1
@@ -436,7 +436,7 @@ async def test_batch_update(
436436
.where(Asset.TYPE_NAME.eq(Table.__name__))
437437
.where(Asset.QUALIFIED_NAME.eq(table1.qualified_name))
438438
.include_on_results(Asset.USER_DESCRIPTION)
439-
.aexecute(client=client)
439+
.execute_async(client=client)
440440
)
441441

442442
assert results and results.count == 1
@@ -506,7 +506,7 @@ async def test_batch_update(
506506
.where(Asset.QUALIFIED_NAME.eq(table.qualified_name))
507507
.include_on_results(Asset.IS_PARTIAL)
508508
.include_on_results(Asset.USER_DESCRIPTION)
509-
.aexecute(client=client)
509+
.execute_async(client=client)
510510
)
511511

512512
assert results and results.count == 1

tests/integration/aio/test_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ async def test_client_401_token_refresh(
14871487
.where(CompoundQuery.active_assets())
14881488
.where(CompoundQuery.asset_type(AtlasGlossary))
14891489
.page_size(100)
1490-
.aexecute(client=client)
1490+
.execute_async(client=client)
14911491
)
14921492

14931493
# Case 2: Invalid user_id
@@ -1502,7 +1502,7 @@ async def test_client_401_token_refresh(
15021502
.where(CompoundQuery.active_assets())
15031503
.where(CompoundQuery.asset_type(AtlasGlossary))
15041504
.page_size(100)
1505-
.aexecute(client=client)
1505+
.execute_async(client=client)
15061506
)
15071507

15081508
# Case 3: Valid user_id associated with the expired token
@@ -1522,7 +1522,7 @@ async def test_client_401_token_refresh(
15221522
.where(CompoundQuery.active_assets())
15231523
.where(CompoundQuery.asset_type(AtlasGlossary))
15241524
.page_size(100)
1525-
.aexecute(client=client)
1525+
.execute_async(client=client)
15261526
)
15271527

15281528
# Confirm the API key has been updated and results are returned
@@ -1561,7 +1561,7 @@ async def test_client_init_from_token_guid(
15611561
.where(CompoundQuery.active_assets())
15621562
.where(CompoundQuery.asset_type(AtlasGlossary))
15631563
.page_size(100)
1564-
.aexecute(client=token_client_from_env_vars)
1564+
.execute_async(client=token_client_from_env_vars)
15651565
)
15661566
assert results and results.count >= 1
15671567

@@ -1570,7 +1570,7 @@ async def test_client_init_from_token_guid(
15701570
.where(CompoundQuery.active_assets())
15711571
.where(CompoundQuery.asset_type(AtlasGlossary))
15721572
.page_size(100)
1573-
.aexecute(client=token_client_custom)
1573+
.execute_async(client=token_client_custom)
15741574
)
15751575
assert results and results.count >= 1
15761576

tests/integration/aio/test_glossary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ async def test_fluent_search(
535535
g_sorted = []
536536

537537
# Execute the async search and collect results into a list first
538-
search_results = await terms.aexecute(client)
538+
search_results = await terms.execute_async(client)
539539
all_results = []
540540
async for asset in search_results:
541541
all_results.append(asset)
@@ -560,7 +560,7 @@ async def test_fluent_search(
560560
],
561561
_includes_on_results=[AtlasGlossaryTerm.ANCHOR.atlan_field_name],
562562
_includes_on_relations=[AtlasGlossary.NAME.atlan_field_name],
563-
).aexecute(client)
563+
).execute_async(client)
564564

565565
guids_alt = []
566566
g_sorted = []
@@ -582,7 +582,7 @@ async def test_fluent_search(
582582
_includes_on_results=["anchor"],
583583
_includes_on_relations=["name"],
584584
sorts=[AtlasGlossaryTerm.NAME.order()],
585-
).aexecute(client)
585+
).execute_async(client)
586586

587587
names = []
588588
names_sorted = []
@@ -1138,7 +1138,7 @@ async def test_search_user_def_relationship_on_terms(
11381138
.include_on_results(AtlasGlossaryTerm.USER_DEF_RELATIONSHIP_TO)
11391139
.include_on_results(AtlasGlossaryTerm.USER_DEF_RELATIONSHIP_FROM)
11401140
.include_relationship_attributes(True)
1141-
.aexecute(client=client)
1141+
.execute_async(client=client)
11421142
)
11431143
assert results and results.count == 2
11441144
async for asset in results:

tests/integration/aio/test_index_search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ async def test_search_source_synced_assets(client: AsyncAtlanClient):
215215
value="Highly Restricted",
216216
)
217217
)
218-
.aexecute(client=client)
218+
.execute_async(client=client)
219219
)
220220
tables = [table async for table in search_results if isinstance(table, Table)]
221221
_assert_source_tag(tables, EXISTING_SOURCE_SYNCED_TAG, "Highly Restricted")
@@ -287,7 +287,7 @@ async def test_source_tag_assign_with_value(client: AsyncAtlanClient, table: Tab
287287
value="Not Restricted",
288288
)
289289
)
290-
.aexecute(client=client)
290+
.execute_async(client=client)
291291
)
292292
tables = [table async for table in search_results if isinstance(table, Table)]
293293

@@ -320,7 +320,7 @@ async def test_search_source_specific_custom_attributes(
320320
.where(CompoundQuery.active_assets())
321321
.where(Column.QUALIFIED_NAME.eq(snowflake_column_qn))
322322
.include_on_results(Column.CUSTOM_ATTRIBUTES)
323-
.aexecute(client=client)
323+
.execute_async(client=client)
324324
)
325325
assert results and results.count == 1
326326
assert results.current_page() and len(results.current_page()) == 1
@@ -460,7 +460,7 @@ async def test_search_pagination(mock_logger, client: AsyncAtlanClient):
460460
.where(CompoundQuery.active_assets())
461461
.where(CompoundQuery.asset_type(AtlasGlossaryTerm))
462462
.page_size(size)
463-
).aexecute(client, bulk=True)
463+
).execute_async(client, bulk=True)
464464
expected_sorts = [
465465
Asset.CREATE_TIME.order(SortOrder.ASCENDING),
466466
Asset.GUID.order(SortOrder.ASCENDING),

0 commit comments

Comments
 (0)