Skip to main content
Version: 1.5.0 (latest)

sources.filesystem.helpers

Helpers for the filesystem resource.

fsspec_from_resource

def fsspec_from_resource(
filesystem_instance: DltResource) -> AbstractFileSystem

[view_source]

Extract authorized fsspec client from a filesystem resource

add_columns

def add_columns(columns: List[str],
rows: List[List[Any]]) -> List[Dict[str, Any]]

[view_source]

Adds column names to the given rows.

Arguments:

  • columns List[str] - The column names.
  • rows List[List[Any]] - The rows.

Returns:

List[Dict[str, Any]]: The rows with column names.

fetch_arrow

def fetch_arrow(file_data, chunk_size: int) -> Iterable[TDataItem]

[view_source]

Fetches data from the given CSV file.

Arguments:

  • file_data DuckDBPyRelation - The CSV file data.
  • chunk_size int - The number of rows to read at once.

Yields:

  • Iterable[TDataItem] - Data items, read from the given CSV file.

fetch_json

def fetch_json(file_data, chunk_size: int) -> List[Dict[str, Any]]

[view_source]

Fetches data from the given CSV file.

Arguments:

  • file_data DuckDBPyRelation - The CSV file data.
  • chunk_size int - The number of rows to read at once.

Yields:

  • Iterable[TDataItem] - Data items, read from the given CSV file.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.