tdfs4ds.serve.dataset_code¶
tdfs4ds.serve.dataset_code
¶
The Python that builds a dataset, as the Dataset builder would (0.3.4.0).
dataset_python(...) renders the tdfs4ds.build_dataset /
tdfs4ds.build_historical_dataset call that the builder's Create runs for the
same form (the arguments come from the same parsing: panels._builder_selection,
_builder_kind, _builder_offsets), plus one explanation per argument. Pure:
no database access, so it is tested offline. Credentials are never written: the host
and user are filled in when known, the password is asked with getpass.
_KINDS
module-attribute
¶
_KINDS = {'current': 'A snapshot valid now: each time the view is read, it returns the values in force at that moment.', 'as_of': 'A snapshot frozen at {as_of}: the values valid at that instant, whatever is ingested later. Useful for a training set that must not move.', 'time_manager': 'A snapshot that follows the TimeManager {time_manager}: the view reads the values valid at its business date, and moving the manager (tm.update(...)) moves the dataset. This is how a scoring dataset follows a roll-out.'}
connect_call
¶
tdfs4ds.connect(...) with the read-only stores when there are some. fallback is the
expression used when no store is known (the page snippets ask; Show Python keeps its marker).
_dict_block
¶
A dict literal with one key per line (easier to read and edit than pprint's).
dataset_python
¶
dataset_python(*, store: str, data_domain: str, entity: str, selected_features: dict, view_name: str, schema_name: str, kind: dict, join_type: str, feature_offsets: dict | None = None, document: bool = False, columns: dict | None = None, host: str = '', username: str = '', readonly=None, nested: dict | None = None) -> dict
The code and its explanation.
nested (panels.nested_summary): a selection with features at a coarser entity; it only adds
a line to the explanation (the call is the same).
Returns {"code": str, "explanation": [(argument, text), ...], "html": str};
columns ({feature: [column names]}, from preview_column_names) only
feeds the explanation.