2323from dagster ._core .definitions .assets .definition .assets_definition import AssetsDefinition
2424from dagster ._core .definitions .definitions_class import Definitions
2525from dagster ._core .definitions .job_base import InMemoryJob
26- from dagster ._core .definitions .partitions .definition import StaticPartitionsDefinition
27- from dagster ._core .definitions .source_asset import SourceAsset
2826from dagster ._core .definitions .unresolved_asset_job_definition import define_asset_job
2927from dagster ._core .events import DagsterEventType
3028from dagster ._core .execution .api import create_execution_plan , execute_plan
@@ -81,10 +79,6 @@ def basic_external_plan_execution():
8179
8280
8381@pytest .mark .nettest
84- @pytest .mark .skip (
85- "Blob this depends on does not exist. See"
86- " https://linear.app/elementl/issue/CORE-83/test-adls2-pickle-io-manager-deletes-recursively-disabled-reenable-it"
87- )
8882def test_adls2_pickle_io_manager_deletes_recursively (storage_account , file_system , credential ):
8983 job = define_inty_job ()
9084
@@ -151,10 +145,6 @@ def test_adls2_pickle_io_manager_deletes_recursively(storage_account, file_syste
151145
152146
153147@pytest .mark .nettest
154- @pytest .mark .skip (
155- "Blob this depends on does not exist. See"
156- " https://linear.app/elementl/issue/CORE-83/test-adls2-pickle-io-manager-deletes-recursively-disabled-reenable-it"
157- )
158148def test_adls2_pickle_io_manager_execution (storage_account , file_system , credential ):
159149 job = define_inty_job ()
160150
@@ -235,10 +225,7 @@ def test_adls2_pickle_io_manager_execution(storage_account, file_system, credent
235225 assert io_manager .load_input (context ) == 2
236226
237227
238- @pytest .mark .skip (
239- "Blob this depends on does not exist. See"
240- " https://linear.app/elementl/issue/CORE-83/test-adls2-pickle-io-manager-deletes-recursively-disabled-reenable-it"
241- )
228+ @pytest .mark .nettest
242229def test_asset_io_manager (storage_account , file_system , credential ):
243230 # if you add new assets to this test, make sure that the output names include _id so that we don't
244231 # run into issues with the azure leasing system in CI
@@ -261,37 +248,20 @@ def graph_asset():
261248
262249 @asset (
263250 name = f"upstream_{ _id } " ,
264- ins = {"asset3" : AssetIn (asset_key = AssetKey ([f"asset3_{ _id } " ]))}, # pyright: ignore[reportCallIssue]
251+ ins = {"asset3" : AssetIn (key = AssetKey ([f"asset3_{ _id } " ]))},
265252 )
266253 def upstream (asset3 ):
267254 return asset3 + 1
268255
269- SourceAsset (f"source1_{ _id } " , partitions_def = StaticPartitionsDefinition (["foo" , "bar" ]))
270-
271- # prepopulate storage with source asset
272- io_manager = PickledObjectADLS2IOManager (
273- file_system = file_system ,
274- adls2_client = create_adls2_client (storage_account , credential ),
275- blob_client = create_blob_client (storage_account , credential ),
276- lease_client_constructor = DataLakeLeaseClient ,
277- )
278- for partition_key in ["foo" , "bar" ]:
279- context = build_output_context (
280- step_key = f"source1_{ _id } " ,
281- name = "result" ,
282- run_id = make_new_run_id (),
283- dagster_type = resolve_dagster_type (int ),
284- partition_key = partition_key ,
285- )
286- io_manager .handle_output (context , 1 )
287-
288256 @asset (
289257 name = f"downstream_{ _id } " ,
290- ins = {"upstream" : AssetIn (asset_key = AssetKey ([f"upstream_{ _id } " ]))}, # pyright: ignore[reportCallIssue]
258+ ins = {
259+ "upstream" : AssetIn (key = AssetKey ([f"upstream_{ _id } " ])),
260+ },
291261 )
292- def downstream (upstream , source ):
262+ def downstream (upstream ):
293263 assert upstream == 7
294- return 1 + upstream + source [ "foo" ] + source [ "bar" ]
264+ return 1 + upstream
295265
296266 asset_job = Definitions (
297267 assets = [upstream , downstream , AssetsDefinition .from_graph (graph_asset )],
@@ -314,6 +284,11 @@ def downstream(upstream, source):
314284 result = asset_job .execute_in_process (run_config = run_config )
315285 assert result .success
316286
287+ # overwriting the same bucket still works
288+
289+ result = asset_job .execute_in_process (run_config = run_config )
290+ assert result .success
291+
317292
318293def test_with_fake_adls2_resource ():
319294 job = define_inty_job (adls_io_resource = fake_adls2_resource )
0 commit comments