Skip to content

Commit c77e8d5

Browse files
committed
Fix integration test and Not implemented exception in purge
1 parent a3d68a2 commit c77e8d5

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

src/apify/storage_clients/_apify/_dataset_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ async def open(
129129

130130
@override
131131
async def purge(self) -> None:
132-
# TODO: better?
133-
# https://github.com/apify/apify-sdk-python/issues/469
134-
async with self._lock:
135-
await self._api_client.delete()
132+
raise NotImplementedError(
133+
'Purging datasets is not supported in the Apify platform. '
134+
'Use the `drop` method to delete the dataset instead.'
135+
)
136136

137137
@override
138138
async def drop(self) -> None:

src/apify/storage_clients/_apify/_key_value_store_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ async def open(
130130

131131
@override
132132
async def purge(self) -> None:
133-
# TODO: better?
134-
# https://github.com/apify/apify-sdk-python/issues/469
135-
async with self._lock:
136-
await self._api_client.delete()
133+
raise NotImplementedError(
134+
'Purging key-value stores is not supported in the Apify platform. '
135+
'Use the `drop` method to delete the key-value store instead.'
136+
)
137137

138138
@override
139139
async def drop(self) -> None:

src/apify/storage_clients/_apify/_request_queue_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ async def open(
166166

167167
@override
168168
async def purge(self) -> None:
169-
# TODO: better?
170-
# https://github.com/apify/apify-sdk-python/issues/469
171-
async with self._lock:
172-
await self._api_client.delete()
169+
raise NotImplementedError(
170+
'Purging the request queue is not supported in the Apify platform. '
171+
'Use the `drop` method to delete the request queue instead.'
172+
)
173173

174174
@override
175175
async def drop(self) -> None:

tests/integration/test_actor_api_helpers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ async def main() -> None:
4646
assert len(env_dict.get('actor_id', '')) == 17
4747
assert len(env_dict.get('actor_run_id', '')) == 17
4848
assert len(env_dict.get('user_id', '')) == 17
49-
assert len(env_dict.get('default_dataset_id', '')) == 17
50-
assert len(env_dict.get('default_key_value_store_id', '')) == 17
51-
assert len(env_dict.get('default_request_queue_id', '')) == 17
5249

5350
actor = await make_actor(label='get-env', main_func=main)
5451
run_result = await run_actor(actor)

0 commit comments

Comments
 (0)