Skip to content

Commit

Permalink
Add ability to parse file structure in .csvAdapter πŸ“‚
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed Mar 6, 2024
1 parent 7aae9ff commit 9ebec70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tiled/adapters/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ..server.object_cache import NO_CACHE, get_object_cache
from ..structures.core import StructureFamily
from ..structures.table import TableStructure
from ..utils import path_from_uri
from .dataframe import DataFrameAdapter

Expand Down Expand Up @@ -67,6 +68,9 @@ def __init__(
# TODO Store data_uris instead and generalize to non-file schemes.
self._partition_paths = [path_from_uri(uri) for uri in data_uris]
self._metadata = metadata or {}
if structure is None:
table = dask.dataframe.read_csv(self._partition_paths)
structure = TableStructure.from_dask_dataframe(table)
self._structure = structure
self.specs = list(specs or [])
self.access_policy = access_policy
Expand Down

0 comments on commit 9ebec70

Please sign in to comment.