4 ms·
Yeah, I'd prefer the pandas call look like ``` from csvbase import CSVBASE_FS pd.read_csv('//calpaterson/onion-vox-pops', fsspec=CSVBASE_FS) ```
by philomath_mn 3y ago
Yeah, I'd prefer the pandas call look like
```
from csvbase import CSVBASE_FS
pd.read_csv('//calpaterson/onion-vox-pops', fsspec=CSVBASE_FS)
```
- kstrauser 3y agoI vastly, hugely, enormously prefer that pattern. It’s not as pretty as the blog post, but it’s so explicit and easy to understand at a glance. If I’d never heard of csvbase or fsspec before seeing that code, I’d still know what to look for and how to debug it. At 2PM when I’m well rested, caffeinated, and alert, the original code is clever and lovely. At 2AM, I want this kind of easy to understand explicitness.
- philomath_mn 3y agoLooks like explicit fsspec usage is possible: ``` fs = fsspec.implementations.local.LocalFileSystem() with fs.open('test.csv', mode='r') as fp: print(pd.read_csv(StringIO(fp.read()))) ```