Skip to content

Commit 866d61e

Browse files
committed
Revert "set autocommit=false as default for ZonalFile"
This reverts commit d51c8c3.
1 parent ca976d6 commit 866d61e

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

gcsfs/extended_gcsfs.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def _open(
122122
acl=None,
123123
consistency=None,
124124
metadata=None,
125-
autocommit=None,
125+
autocommit=True,
126126
fixed_key_metadata=None,
127127
generation=None,
128128
**kwargs,
@@ -131,16 +131,7 @@ def _open(
131131
Open a file.
132132
"""
133133
bucket, _, _ = self.split_path(path)
134-
135-
# Determine the final autocommit value based on bucket type. For zonal
136-
# buckets, default autocommit is False; for others, it is True.
137-
final_autocommit = autocommit
138134
bucket_type = self._sync_lookup_bucket_type(bucket)
139-
if autocommit is None:
140-
if bucket_type == BucketType.ZONAL_HIERARCHICAL:
141-
final_autocommit = False
142-
else:
143-
final_autocommit = True
144135
return gcs_file_types[bucket_type](
145136
self,
146137
path,
@@ -150,7 +141,7 @@ def _open(
150141
consistency=consistency,
151142
metadata=metadata,
152143
acl=acl,
153-
autocommit=final_autocommit,
144+
autocommit=autocommit,
154145
fixed_key_metadata=fixed_key_metadata,
155146
generation=generation,
156147
**kwargs,

gcsfs/zonal_file.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,18 @@
1010

1111
logger = logging.getLogger("gcsfs.zonal_file")
1212

13-
DEFAULT_BLOCK_SIZE = 5 * 2**20
14-
1513

1614
class ZonalFile(GCSFile):
1715
"""
1816
ZonalFile is subclass of GCSFile and handles data operations from
1917
Zonal buckets only using a high-performance gRPC path.
2018
"""
2119

22-
def __init__(
23-
self,
24-
gcsfs,
25-
path,
26-
mode="rb",
27-
block_size=DEFAULT_BLOCK_SIZE,
28-
autocommit=False,
29-
*args,
30-
**kwargs,
31-
):
20+
def __init__(self, *args, **kwargs):
3221
"""
3322
Initializes the ZonalFile object.
3423
"""
35-
super().__init__(gcsfs, path, mode, block_size, autocommit, *args, **kwargs)
24+
super().__init__(*args, **kwargs)
3625
self.mrd = None
3726
if "r" in self.mode:
3827
self.mrd = asyn.sync(
@@ -48,7 +37,7 @@ def __init__(
4837
)
4938
else:
5039
raise NotImplementedError(
51-
"Only 'r' and 'w' modes are currently supported for Zonal buckets."
40+
"Only read operations are currently supported for Zonal buckets."
5241
)
5342

5443
async def _init_mrd(self, bucket_name, object_name, generation=None):

0 commit comments

Comments
 (0)