xedocs 0.2.37__py3-none-any.whl → 0.2.39__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xedocs/__init__.py +1 -1
- xedocs/dispatchers.py +2 -2
- xedocs/utils.py +26 -7
- {xedocs-0.2.37.dist-info → xedocs-0.2.39.dist-info}/METADATA +1 -1
- {xedocs-0.2.37.dist-info → xedocs-0.2.39.dist-info}/RECORD +8 -8
- {xedocs-0.2.37.dist-info → xedocs-0.2.39.dist-info}/WHEEL +1 -1
- {xedocs-0.2.37.dist-info → xedocs-0.2.39.dist-info}/AUTHORS.rst +0 -0
- {xedocs-0.2.37.dist-info → xedocs-0.2.39.dist-info}/entry_points.txt +0 -0
xedocs/__init__.py
CHANGED
xedocs/dispatchers.py
CHANGED
@@ -54,8 +54,8 @@ def read_csv_files(path, **kwargs) -> List[dict]:
|
|
54
54
|
docs =[]
|
55
55
|
|
56
56
|
with fsspec.open_files(path, **kwargs) as fs:
|
57
|
-
|
58
|
-
|
57
|
+
kwargs = rframe.utils.filter_kwargs(pd.read_csv, kwargs)
|
58
|
+
for f in fs:
|
59
59
|
ds = pd.read_csv(f, **kwargs).to_dict(orient='records')
|
60
60
|
docs.extend(ds)
|
61
61
|
return docs
|
xedocs/utils.py
CHANGED
@@ -134,20 +134,38 @@ class LazyFileAccessor(DataAccessor):
|
|
134
134
|
def iter_path_records(self, ignore_paths=(), **labels):
|
135
135
|
for path in self.urlpaths:
|
136
136
|
glob_patttern = self.format_to_glob(path)
|
137
|
-
fs, _, fpaths = fsspec.get_fs_token_paths(glob_patttern,
|
138
|
-
|
139
|
-
|
137
|
+
fs, _, fpaths = fsspec.get_fs_token_paths(glob_patttern, storage_options=self.storage_options)
|
138
|
+
|
139
|
+
# Always define original_protocol
|
140
|
+
original_protocol = fs.protocol if fs.protocol else 'file'
|
141
|
+
if isinstance(original_protocol, tuple):
|
142
|
+
original_protocol = original_protocol[0]
|
143
|
+
else:
|
144
|
+
original_protocol = original_protocol
|
145
|
+
|
146
|
+
# Debug prints
|
147
|
+
print(f"\n[DEBUG]")
|
148
|
+
print(f"Processing path: {path}")
|
149
|
+
print(f"fs.protocol: {fs.protocol}")
|
150
|
+
print(f"Original protocol: {original_protocol}")
|
151
|
+
print(f"Glob pattern: {glob_patttern}")
|
152
|
+
print(f"File paths: {fpaths}")
|
153
|
+
|
154
|
+
pattern = path.replace(f"{original_protocol}://", "")
|
140
155
|
pattern = parse.compile(self.glob_to_format(pattern))
|
156
|
+
|
157
|
+
# More debug prints
|
158
|
+
print(f"Parse pattern: {pattern}")
|
159
|
+
|
141
160
|
loaded = set(ignore_paths)
|
142
|
-
|
161
|
+
|
143
162
|
for fpath in fpaths:
|
144
163
|
if fpath in loaded:
|
145
164
|
continue
|
146
165
|
r = pattern.parse(fpath)
|
147
166
|
if r is None:
|
148
167
|
continue
|
149
|
-
for k,vs in labels.items():
|
150
|
-
|
168
|
+
for k, vs in labels.items():
|
151
169
|
if vs is None:
|
152
170
|
continue
|
153
171
|
if not isinstance(vs, list):
|
@@ -164,10 +182,11 @@ class LazyFileAccessor(DataAccessor):
|
|
164
182
|
if label not in vs:
|
165
183
|
break
|
166
184
|
else:
|
167
|
-
records = read_files(fpath, protocol=
|
185
|
+
records = read_files(fpath, protocol=original_protocol, **fs.storage_options)
|
168
186
|
yield fpath, records
|
169
187
|
self.loaded.add(fpath)
|
170
188
|
|
189
|
+
|
171
190
|
def load_files(self, **labels):
|
172
191
|
index_fields = list(self.schema.get_index_fields())
|
173
192
|
if len(index_fields) == 1:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
xedocs/__init__.py,sha256=
|
1
|
+
xedocs/__init__.py,sha256=wH2b2ynVVq-ZQwqENUSAJhPA_Z7fD8mBQ_9woNgkbOI,1054
|
2
2
|
xedocs/_settings.py,sha256=_Fjj5XJBHBrN6N1Dqs_JzovbEcF6--5BGnAggK1ksck,4199
|
3
3
|
xedocs/_straxen_plugin.py,sha256=bxKWkVDNCS0Mah_GGNEvE8TCk-ibrY8xJbO0UMvfajM,1904
|
4
4
|
xedocs/cli.py,sha256=1oZXa4Iqs-ANRTABZP8K6e3oSIatKnJNhQ1DZ4rsNrc,3493
|
@@ -10,7 +10,7 @@ xedocs/data_locations/data_folder.py,sha256=reCX7CgZMjXJYWdsuMI3JLmSgwd2RTMjPO7i
|
|
10
10
|
xedocs/data_locations/github.py,sha256=Tg3Mwo1vUE7Z3gzhjgEtSDlEtUx7F0gY8U-Uj89GIZI,2683
|
11
11
|
xedocs/data_locations/mongodb.py,sha256=2tVlHgSlw7mVQ9zRtLz2DPZgyJ7d5JNYMZm0VO_4VDo,3203
|
12
12
|
xedocs/databases.py,sha256=t8WIZt0zf_DHvie2NG-q0CNi7zsXgOVyvrKunCz0lhc,1799
|
13
|
-
xedocs/dispatchers.py,sha256=
|
13
|
+
xedocs/dispatchers.py,sha256=zY64OzMXwcJyuvM9pgsciMcmpaML7nPOIRS1r_lG2p8,2662
|
14
14
|
xedocs/entrypoints.py,sha256=1y61KiT0gaTWGlM-PHawXSSzI3ayEhjOucNAkgH_Aps,2098
|
15
15
|
xedocs/json_records.py,sha256=lUPUkaDkRvM_KSJ1nNQzB0HgAvKxWPxMUFgtQoFJ1pE,1768
|
16
16
|
xedocs/regex_dispatcher.py,sha256=LXUN4nKRCnVX5b7_KOTMuUh_jCPrVm1W3UusRCjnrac,2481
|
@@ -78,12 +78,12 @@ xedocs/schemas/pmt_data/pmt_installs.py,sha256=zVz04RbVvS9DpnM6kp8Ql14g1aOtRsqWA
|
|
78
78
|
xedocs/schemas/pmt_data/pmts.py,sha256=VTDpDPz0HdTlfkPypN6CFjmuxEUNJj0-cC6uqRRuXZs,271
|
79
79
|
xedocs/schemas/pmt_data/voltage_changes.py,sha256=ieTNCSoE4A3VHrWZ3Hk5HN_q5Nrwu04jwqji7bgbJto,428
|
80
80
|
xedocs/schemas/pmt_data/voltage_settings.py,sha256=L2cScDQNviWgAlWvMRjnIEgsP0urVg0gYWAxK3FrFPc,428
|
81
|
-
xedocs/utils.py,sha256=
|
81
|
+
xedocs/utils.py,sha256=KYdyye-avgteZiqwDgIB4fx4P3Kg6scENbxoD7MLcXw,9049
|
82
82
|
xedocs/widgets.py,sha256=l2pgQaWqycZQF5pF6eEeLuHdqjVBkJ8OB-o-mcivMl4,28810
|
83
83
|
xedocs/xedocs.py,sha256=Dk-ld5X6qB6hrp40svDkJX_9K0MKkZTxal-fLVQpIz8,6949
|
84
84
|
xedocs/xenon_config.py,sha256=QQlg2icofZWq_UAh5kDSuViai0uP_3ClozNNv6mpx3s,2674
|
85
|
-
xedocs-0.2.
|
86
|
-
xedocs-0.2.
|
87
|
-
xedocs-0.2.
|
88
|
-
xedocs-0.2.
|
89
|
-
xedocs-0.2.
|
85
|
+
xedocs-0.2.39.dist-info/AUTHORS.rst,sha256=7XNtvXT_irnC5nzau-Al_VVmmhk8EgW811pPs8OXgBo,164
|
86
|
+
xedocs-0.2.39.dist-info/METADATA,sha256=rS02k5-w_QZz3FPZTg5jJaO0N0gTF8kXZJYj8TfG7HU,5827
|
87
|
+
xedocs-0.2.39.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
88
|
+
xedocs-0.2.39.dist-info/entry_points.txt,sha256=AfKuejqaCB-nA4rYbuWtMcR0d-t4nNzrM3s8V_e7YSk,92
|
89
|
+
xedocs-0.2.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|