File tree Expand file tree Collapse file tree
packages/bigframes/tests/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222from datetime import datetime
2323from typing import Dict , Generator , Optional
2424
25+ import fsspec # type: ignore[import-untyped]
26+ import gcsfs # type: ignore[import-untyped]
2527import google .api_core .exceptions
2628import google .cloud .bigquery as bigquery
2729import google .cloud .bigquery_connection_v1 as bigquery_connection_v1
@@ -70,6 +72,15 @@ def _hash_digest_file(hasher, filepath):
7072 hasher .update (chunk )
7173
7274
75+ @pytest .fixture (scope = "session" , autouse = True )
76+ def configure_gcsfs ():
77+ # gcsfs by default uses a cache that can be stale, causing file loads to
78+ # fail if the file was uploaded indirectly (eg via bq export job) during the
79+ # course of the tests. disable the cache to avoid this.
80+ fsspec .config .conf ["gcs" ] = {"use_listings_cache" : False }
81+ gcsfs .GCSFileSystem .clear_instance_cache ()
82+
83+
7384@pytest .fixture (scope = "session" )
7485def tokyo_location () -> str :
7586 return TOKYO_LOCATION
You can’t perform that action at this time.
0 commit comments