@@ -186,35 +186,35 @@ def active_chunk_function(method, *args, **kwargs):
186186 # with `cf.active_storage(True)`
187187 from activestorage import Active
188188
189- filename = x .get_filename ()
190- address = x .get_address ()
191- max_requests = active_storage_max_requests ()
189+ info = is_log_level_info (logger )
190+
191+ max_requests = active_storage_max_requests ().value
192+ storage_options = None
193+ address = None
194+ dataset = x .get_variable (None )
195+ if dataset is None :
196+ # Dateaset is a string, not a variable object.
197+ storage_options = x .get_storage_options ()
198+ address = x .get_address ()
199+ dataset = x .get_filename ()
200+
192201 active_kwargs = {
193- "uri " : "/" . join ( filename . split ( "/" )[ 3 :]) ,
202+ "dataset " : dataset ,
194203 "ncvar" : address ,
195- "storage_options" : x .get_storage_options (),
204+ "axis" : axis ,
205+ "storage_options" : storage_options ,
196206 "active_storage_url" : url ,
197- "storage_type" : "s3" ,
198207 "max_threads" : max_requests ,
199208 }
200- # WARNING: The "uri", "storage_options", and "storage_type" keys
201- # of the `active_kwargs` dictionary are currently
202- # formatted according to the whims of the `Active` class
203- # (i.e. the pyfive branch of PyActiveStorage). Future
204- # versions of `Active` will have a better API, that will
205- # require improvements to `active_kwargs`.
206209
207210 index = x .index ()
208-
209- details = (
210- f"{ method !r} (file={ filename } , address={ address } , url={ url } , "
211- f"Dask chunk={ index } )"
212- )
213-
214- info = is_log_level_info (logger )
215211 if info :
216212 # Do some detailed logging
217213 start = time .time ()
214+ details = (
215+ f"{ method !r} (dataset={ dataset !r} , ncvar={ address } , "
216+ f"Dask chunk={ index } )"
217+ )
218218 logger .info (
219219 f"STARTED active storage { details } : { datetime .datetime .now ()} "
220220 ) # pragma: no cover
@@ -227,8 +227,7 @@ def active_chunk_function(method, *args, **kwargs):
227227 # reduction on the remote server
228228 #
229229 # WARNING: The `_version` API of `Active` is likely to change from
230- # the current version (i.e. the pyfive branch of
231- # PyActiveStorage)
230+ # the current version
232231 active ._version = 2
233232
234233 # ----------------------------------------------------------------
0 commit comments