@@ -16,7 +16,7 @@ def clear_cache():
16
16
dak .lib .core .dak_cache .clear ()
17
17
18
18
19
- @pytest .fixture (scope = "session" )
19
+ @pytest .fixture ()
20
20
def single_record_file (tmp_path_factory : pytest .TempPathFactory ) -> str :
21
21
fname = tmp_path_factory .mktemp ("data" ) / "single_record.json"
22
22
record = {"record" : [1 , 2 , 3 ]}
@@ -25,7 +25,7 @@ def single_record_file(tmp_path_factory: pytest.TempPathFactory) -> str:
25
25
return str (fname )
26
26
27
27
28
- @pytest .fixture (scope = "session" )
28
+ @pytest .fixture ()
29
29
def ndjson_points1 (tmp_path_factory : pytest .TempPathFactory ) -> str :
30
30
array = daktu .awkward_xy_points ()
31
31
fname = tmp_path_factory .mktemp ("data" ) / "points_ndjson1.json"
@@ -35,7 +35,7 @@ def ndjson_points1(tmp_path_factory: pytest.TempPathFactory) -> str:
35
35
return str (fname )
36
36
37
37
38
- @pytest .fixture (scope = "session" )
38
+ @pytest .fixture ()
39
39
def ndjson_points1_str (tmp_path_factory : pytest .TempPathFactory ) -> str :
40
40
array = daktu .awkward_xy_points_str ()
41
41
fname = tmp_path_factory .mktemp ("data" ) / "points_ndjson1.json"
@@ -45,7 +45,7 @@ def ndjson_points1_str(tmp_path_factory: pytest.TempPathFactory) -> str:
45
45
return str (fname )
46
46
47
47
48
- @pytest .fixture (scope = "session" )
48
+ @pytest .fixture ()
49
49
def ndjson_points2 (tmp_path_factory : pytest .TempPathFactory ) -> str :
50
50
array = daktu .awkward_xy_points ()
51
51
fname = tmp_path_factory .mktemp ("data" ) / "points_ndjson2.json"
@@ -55,77 +55,77 @@ def ndjson_points2(tmp_path_factory: pytest.TempPathFactory) -> str:
55
55
return str (fname )
56
56
57
57
58
- @pytest .fixture (scope = "session" )
58
+ @pytest .fixture ()
59
59
def ndjson_points_file (ndjson_points1 : str ) -> str :
60
60
return ndjson_points1
61
61
62
62
63
- @pytest .fixture (scope = "session" )
63
+ @pytest .fixture ()
64
64
def ndjson_points_file_str (ndjson_points1_str : str ) -> str :
65
65
return ndjson_points1_str
66
66
67
67
68
- @pytest .fixture (scope = "session" )
68
+ @pytest .fixture ()
69
69
def daa (ndjson_points1 : str ) -> dak .Array :
70
70
return dak .from_json ([ndjson_points1 ] * 3 )
71
71
72
72
73
- @pytest .fixture (scope = "session" )
73
+ @pytest .fixture ()
74
74
def pq_points_dir (daa : dak .Array , tmp_path_factory : pytest .TempPathFactory ) -> str :
75
75
pqdir = tmp_path_factory .mktemp ("pqfiles" )
76
76
dak .to_parquet (daa , str (pqdir ))
77
77
return str (pqdir )
78
78
79
79
80
- @pytest .fixture (scope = "session" )
80
+ @pytest .fixture ()
81
81
def daa_parquet (pq_points_dir : str ) -> dak .Array :
82
82
return cast (dak .Array , dak .from_parquet (pq_points_dir ))
83
83
84
84
85
- @pytest .fixture (scope = "session" )
85
+ @pytest .fixture ()
86
86
def daa_str (ndjson_points1_str : str ) -> dak .Array :
87
87
return dak .from_json ([ndjson_points1_str ] * 3 )
88
88
89
89
90
- @pytest .fixture (scope = "session" )
90
+ @pytest .fixture ()
91
91
def caa (ndjson_points1 : str ) -> ak .Array :
92
92
with open (ndjson_points1 , "rb" ) as f :
93
93
a = ak .from_json (f , line_delimited = True )
94
94
return ak .concatenate ([a , a , a ])
95
95
96
96
97
- @pytest .fixture (scope = "session" )
97
+ @pytest .fixture ()
98
98
def caa_str (ndjson_points1_str : str ) -> ak .Array :
99
99
with open (ndjson_points1_str , "rb" ) as f :
100
100
a = ak .from_json (f , line_delimited = True )
101
101
return ak .concatenate ([a , a , a ])
102
102
103
103
104
- @pytest .fixture (scope = "session" )
104
+ @pytest .fixture ()
105
105
def daa_p1 (ndjson_points1 : str ) -> dak .Array :
106
106
return dak .from_json ([ndjson_points1 ] * 3 )
107
107
108
108
109
- @pytest .fixture (scope = "session" )
109
+ @pytest .fixture ()
110
110
def daa_p2 (ndjson_points2 : str ) -> dak .Array :
111
111
return dak .from_json ([ndjson_points2 ] * 3 )
112
112
113
113
114
- @pytest .fixture (scope = "session" )
114
+ @pytest .fixture ()
115
115
def caa_p1 (ndjson_points1 : str ) -> ak .Array :
116
116
with open (ndjson_points1 ) as f :
117
117
lines = [json .loads (line ) for line in f ]
118
118
return ak .Array (lines * 3 )
119
119
120
120
121
- @pytest .fixture (scope = "session" )
121
+ @pytest .fixture ()
122
122
def caa_p2 (ndjson_points2 : str ) -> ak .Array :
123
123
with open (ndjson_points2 ) as f :
124
124
lines = [json .loads (line ) for line in f ]
125
125
return ak .Array (lines * 3 )
126
126
127
127
128
- @pytest .fixture (scope = "session" )
128
+ @pytest .fixture ()
129
129
def L1 () -> list [list [dict [str , float ]]]:
130
130
return [
131
131
[{"x" : 1.0 , "y" : 1.1 }, {"x" : 2.0 , "y" : 2.2 }, {"x" : 3 , "y" : 3.3 }],
@@ -136,7 +136,7 @@ def L1() -> list[list[dict[str, float]]]:
136
136
]
137
137
138
138
139
- @pytest .fixture (scope = "session" )
139
+ @pytest .fixture ()
140
140
def L2 () -> list [list [dict [str , float ]]]:
141
141
return [
142
142
[{"x" : 0.9 , "y" : 1.0 }, {"x" : 2.0 , "y" : 2.2 }, {"x" : 2.9 , "y" : 3.0 }],
@@ -147,7 +147,7 @@ def L2() -> list[list[dict[str, float]]]:
147
147
]
148
148
149
149
150
- @pytest .fixture (scope = "session" )
150
+ @pytest .fixture ()
151
151
def L3 () -> list [list [dict [str , float ]]]:
152
152
return [
153
153
[{"x" : 1.9 , "y" : 9.0 }, {"x" : 2.0 , "y" : 8.2 }, {"x" : 9.9 , "y" : 9.0 }],
@@ -158,7 +158,7 @@ def L3() -> list[list[dict[str, float]]]:
158
158
]
159
159
160
160
161
- @pytest .fixture (scope = "session" )
161
+ @pytest .fixture ()
162
162
def L4 () -> list [list [dict [str , float ]] | None ]:
163
163
return [
164
164
[{"x" : 1.9 , "y" : 9.0 }, {"x" : 2.0 , "y" : 8.2 }, {"x" : 9.9 , "y" : 9.0 }],
@@ -169,14 +169,14 @@ def L4() -> list[list[dict[str, float]] | None]:
169
169
]
170
170
171
171
172
- @pytest .fixture (scope = "session" )
172
+ @pytest .fixture ()
173
173
def caa_parquet (caa : ak .Array , tmp_path_factory : pytest .TempPathFactory ) -> str :
174
174
fname = tmp_path_factory .mktemp ("parquet_data" ) / "caa.parquet"
175
175
ak .to_parquet (caa , str (fname ), extensionarray = False )
176
176
return str (fname )
177
177
178
178
179
- @pytest .fixture (scope = "session" )
179
+ @pytest .fixture ()
180
180
def unnamed_root_parquet_file (tmp_path_factory : pytest .TempPathFactory ) -> str :
181
181
from dask_awkward .lib .testutils import unnamed_root_ds
182
182
0 commit comments