@@ -365,7 +365,12 @@ def test_spec1_gen_variants():
365365 },
366366 ],
367367 }
368- fsspec .filesystem ("reference" , fo = missing_length_spec , target_protocol = "http" )
368+ fsspec .filesystem (
369+ "reference" ,
370+ fo = missing_length_spec ,
371+ simple_templates = False ,
372+ target_protocol = "http" ,
373+ )
369374
370375 with pytest .raises (ValueError ):
371376 missing_offset_spec = {
@@ -380,7 +385,12 @@ def test_spec1_gen_variants():
380385 },
381386 ],
382387 }
383- fsspec .filesystem ("reference" , fo = missing_offset_spec , target_protocol = "http" )
388+ fsspec .filesystem (
389+ "reference" ,
390+ simple_templates = False ,
391+ fo = missing_offset_spec ,
392+ target_protocol = "http" ,
393+ )
384394
385395 url_only_gen_spec = {
386396 "version" : 1 ,
@@ -394,7 +404,12 @@ def test_spec1_gen_variants():
394404 ],
395405 }
396406
397- fs = fsspec .filesystem ("reference" , fo = url_only_gen_spec , target_protocol = "http" )
407+ fs = fsspec .filesystem (
408+ "reference" ,
409+ simple_templates = False ,
410+ fo = url_only_gen_spec ,
411+ target_protocol = "http" ,
412+ )
398413 assert fs .references == {
399414 "gen_key0" : ["http://server.domain/path_0" ],
400415 "gen_key1" : ["http://server.domain/path_1" ],
@@ -857,10 +872,7 @@ def test_deep_parq(m, engine):
857872 pytest .importorskip ("kerchunk" )
858873 zarr = pytest .importorskip ("zarr" )
859874 skip_zarr_2 ()
860- if zarr .__version__ .split ("." ) >= ["3" , "2" ]:
861- kw = {}
862- else :
863- kw = {"zarr_format" : 2 }
875+ kw = {"zarr_format" : 2 }
864876
865877 lz = fsspec .implementations .reference .LazyReferenceMapper .create (
866878 "memory://out.parq" ,
@@ -886,7 +898,7 @@ def test_deep_parq(m, engine):
886898 g = zarr .open_group (
887899 "reference://" ,
888900 storage_options = {"fo" : "memory://out.parq" , "remote_protocol" : "memory" },
889- zarr_version = 2 ,
901+ ** kw ,
890902 )
891903 assert g ["instant" ]["one" ][:].tolist () == [1 , 2 , 3 ]
892904 assert sorted (_ ["name" ] for _ in lz .ls ("" )) == [
@@ -965,3 +977,21 @@ def test_parquet_no_references(m):
965977 lz .flush ()
966978
967979 assert arr [...].tolist () == 1 # scalar, equal to fill value
980+
981+
982+ def test_no_default_jinja_execution ():
983+ pytest .importorskip ("jinja2" )
984+ manifest = {
985+ "version" : 1 ,
986+ "templates" : {},
987+ "refs" : {},
988+ "gen" : [
989+ {"key" : "{{ 1 / 0 }}" , "url" : "file:///dev/null" , "dimensions" : {"i" : [0 ]}}
990+ ],
991+ }
992+
993+ # no error - not evaluated
994+ fsspec .filesystem ("reference" , fo = manifest )
995+
996+ with pytest .raises (ZeroDivisionError ):
997+ fsspec .filesystem ("reference" , fo = manifest , simple_templates = False )
0 commit comments