catalog_data_source.

import_csv

import_csv(data_source_id: str, table_name: str, location: str, config: Optional[dict[str, Any]])

Import a CSV file from staging into a GDSTORAGE data source.

Parameters

nametypedescription
data_source_idstrData source identification string.
table_namestrName for the table to create or replace.
locationstrLocation string returned by staging_upload.
configOptional[dict[str, Any]]Source config dict, typically from analyze_csv response. Passed as ImportCsvRequestTableSourceConfig kwargs.

Returns

None

Example

# Import a CSV into a GDSTORAGE data source using config from analysis
analysis = sdk.catalog_data_source.analyze_csv(location=location)
config = analysis.to_dict().get("config")
sdk.catalog_data_source.import_csv(
    data_source_id="my-gdstorage-ds",
    table_name="my_table",
    location=location,
    config=config,
)