Skip to content

Commit 7aa2da4

Browse files
committed
updated documentation regarding json metadata
1 parent deb3590 commit 7aa2da4

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

python/lib/sift_client/resources/data_imports.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,24 @@ async def detect_config(
187187
using ``TdmsImportConfig``, ``Hdf5ImportConfig``, or
188188
``Ch10ImportConfig``.
189189
190-
For CSV files, the server can parse an optional JSON metadata row
191-
that auto-populates channel names, units, descriptions, data types,
192-
and enum definitions. Each cell in the row is a JSON object
193-
describing that column. When present, ``first_data_row`` in the
194-
returned config will be set to the row after the metadata row.
195-
Note that enum type definitions are applied server-side during
196-
import but are not included in the returned config.
190+
For CSV files, the server scans the first two rows for an optional
191+
JSON metadata row. Row 1 is checked first; row 2 is checked only
192+
if row 1 is not valid metadata. A row qualifies as metadata when
193+
every cell contains valid JSON that describes either a time column
194+
or a data column. When present, ``first_data_row`` in the returned
195+
config is set to the row after the metadata row.
196+
197+
Each data column cell is a JSON ``ChannelConfig``::
198+
199+
{"name": "speed", "units": "m/s", "dataType": "CHANNEL_DATA_TYPE_DOUBLE"}
200+
201+
The time column cell is a JSON ``CsvTimeColumn``::
202+
203+
{"format": "TIME_FORMAT_ABSOLUTE_RFC3339"}
204+
205+
Enum type definitions and bit field elements can also be specified
206+
in the metadata row; they are applied server-side during import
207+
but are not included in the returned config.
197208
198209
For file types with multiple layouts (e.g. Parquet), ``data_type``
199210
must be specified explicitly.

python/lib/sift_client/resources/sync_stubs/__init__.pyi

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,24 @@ class DataImportAPI:
655655
using ``TdmsImportConfig``, ``Hdf5ImportConfig``, or
656656
``Ch10ImportConfig``.
657657
658-
For CSV files, the server can parse an optional JSON metadata row
659-
that auto-populates channel names, units, descriptions, data types,
660-
and enum definitions. Each cell in the row is a JSON object
661-
describing that column. When present, ``first_data_row`` in the
662-
returned config will be set to the row after the metadata row.
663-
Note that enum type definitions are applied server-side during
664-
import but are not included in the returned config.
658+
For CSV files, the server scans the first two rows for an optional
659+
JSON metadata row. Row 1 is checked first; row 2 is checked only
660+
if row 1 is not valid metadata. A row qualifies as metadata when
661+
every cell contains valid JSON that describes either a time column
662+
or a data column. When present, ``first_data_row`` in the returned
663+
config is set to the row after the metadata row.
664+
665+
Each data column cell is a JSON ``ChannelConfig``::
666+
667+
{"name": "speed", "units": "m/s", "dataType": "CHANNEL_DATA_TYPE_DOUBLE"}
668+
669+
The time column cell is a JSON ``CsvTimeColumn``::
670+
671+
{"format": "TIME_FORMAT_ABSOLUTE_RFC3339"}
672+
673+
Enum type definitions and bit field elements can also be specified
674+
in the metadata row; they are applied server-side during import
675+
but are not included in the returned config.
665676
666677
For file types with multiple layouts (e.g. Parquet), ``data_type``
667678
must be specified explicitly.

0 commit comments

Comments
 (0)