tlc.core.objects.tables.from_url.table_from_csv#

A table populated from a comma-separated values (CSV) string loaded from a URL

Module Contents#

Classes#

Class

Description

TableFromCsv

A table populated from a comma-separated values (CSV) string loaded from a URL.

API#

class tlc.core.objects.tables.from_url.table_from_csv.TableFromCsv(url: tlc.core.url.Url | None = None, created: str | None = None, description: str | None = None, row_cache_url: tlc.core.url.Url | None = None, row_cache_populated: bool | None = None, override_table_rows_schema: Any = None, init_parameters: Any = None, input_url: tlc.core.url.Url | None = None)#

Bases: tlc.core.objects.tables.in_memory_rows_table._InMemoryRowsTable

A table populated from a comma-separated values (CSV) string loaded from a URL.

This class represents a table that is loaded from a CSV file at the given URL. Its Schema is approximated as strings for all columns unless the property override_table_rows_schema is used, in which case:

  • the effective schema is modified with the given overrides, that may be “sparse”

  • the row-values are converted from str to a matching type which may not be exactly the override type, but should be compatible. Ie. if the override type is Int32Value and the value is 123 then the value will be converted to python type int

Parameters:
  • url – URL of the table.

  • created – Creation timestamp.

  • row_cache_url – URL for row cache.

  • row_cache_populated – Flag to indicate if the row cache is populated.

  • override_table_rows_schema – Schema to override the default (naive) table rows schema.

  • init_parameters – Initialization parameters for serialization.

  • input_url – The input URL for the CSV data. This is required.

Raises:

ValueError – if the input URL is not provided.

Parameters:
  • url – The URL of the table.

  • created – The creation time of the table.

  • description – The description of the table.

  • row_cache_url – The URL of the row cache.

  • row_cache_populated – Whether the row cache is populated.

  • override_table_rows_schema – The schema to override the table rows schema.

  • init_parameters – The initial parameters of the table.