TinyChain-Inc / TinyChain-Inc/client
[Python][Hosted ML] Import standard datasets into immutable TinyChain dataset services
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 32
Description
Parent: TinyChain-Inc/tcv2#79
Objective
Provide a Python-client utility that imports common in-memory, file, streaming, and hosted dataset representations into immutable, versioned TinyChain dataset services suitable for hosted ML training.
Initial sources
- pandas
DataFrameandSeries - NumPy arrays and structured arrays
- CSV and compressed CSV
- PyArrow
Table, record batches, and Parquet - Hugging Face
DatasetandIterableDataset - Python iterators/generators yielding bounded batches
Server-side acquisition from remote URLs, Hugging Face Hub, or object storage is a later connector path. The MVP may import data already accessible to the authorized Python process.
Proposed contract
Provide a documented API equivalent to:
dataset = tc.dataset.import_data(
source,
name="training-data",
target="label",
schema=schema,
batch_size=batch_size,
metadata=metadata,
)
Return an immutable dataset revision/handle usable by the training service, not a fully materialized client copy.
Procedure
- Define canonical mappings from supported Python/Arrow types to TinyChain table/tensor/stream types.
- Infer schema where unambiguous and require an explicit override/confirmation for ambiguous or lossy cases.
- Preserve nullability, dimensions, precision, categorical encoding, timestamps/time zones, feature/target roles, and supported metadata.
- Stream bounded chunks with backpressure; never require whole-source materialization.
- Support resumable upload with stable source/import identity and idempotent chunk handling.
- Compute integrity digests and publish an immutable dataset manifest/revision.
- Record source kind, import time, schema, transformations, fidelity warnings, license/use metadata supplied by the user, and client/library versions.
- Represent train/validation/test splits and derived views as manifests/references where possible rather than physical copies.
- Reject corrupt, partial, unauthorized, incompatible, or unsupported data explicitly.
- Keep credentials and unrestricted local paths out of manifests, logs, and error payloads.
- Add local fixtures plus HTTP and PyO3 integration coverage where supported.
Acceptance criteria
- Every initial source type imports through one documented API.
- Large and iterable sources are uploaded in bounded chunks with backpressure.
- Interrupted upload resumes without duplicating an accepted dataset revision or chunk.
- Round-trip fixtures report and satisfy documented schema/type/precision fidelity.
- Ambiguous or lossy conversions require explicit user direction.
- The result is immutable, integrity-verifiable, independently addressable, and authorized.
- Derived splits preserve lineage to the source revision.
- No source credential, unrestricted filesystem path, or unauthorized sample leaks into metadata or diagnostics.
- The resulting handle is consumed by the hosted-training fixture without backend topology configuration.
- Unit, optional-dependency, HTTP, PyO3, interruption, and hostile-input tests pass.
Dependencies and concurrency
- Consumes the dataset/artifact manifest and resumable-transfer contracts from TinyChain-Inc/tcv2#67.
- Uses canonical Python Table/Tensor/service behavior; it must not introduce a second serialization path.
- Can be implemented concurrently with the training-service contract.
- Test fixtures may begin before the final server ingestion route; live HTTP/PyO3 acceptance waits for it.
Non-goals
- Ambient server access to arbitrary local files or remote URLs
- A credentialed Hugging Face Hub backend connector
- Silent lossy coercion
- Loading an entire streaming dataset into memory
- Prescribing a tenant-specific feature schema
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the dataset/artifact manifest and resumable-transfer contracts in TinyChain-Inc/tcv2#67, then review the canonical Python Table/Tensor/service behavior. The work is done when all listed initial source types use one documented API, preserve the required fidelity and lineage, support bounded resumable uploads, and pass the specified unit, optional-dependency, HTTP, PyO3, interruption, and hostile-input tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, numpy, pandas, python
- Domain
- api, data, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100