foundry_dev_tools.clients.schema_inference module#

Implementation of the schema_inference API.

class foundry_dev_tools.clients.schema_inference.SchemaInferenceClient[source]#

Bases: APIClient

SchemaInferenceClient class that implements methods from the ‘foundry-schema-inference’ API.

api_name: ClassVar[str] = 'foundry-schema-inference'#
infer_dataset_schema(dataset_rid, branch='master')[source]#

Calls the foundry-schema-inference service to infer the dataset schema.

Returns dict with foundry schema, if status == SUCCESS

Parameters:
  • dataset_rid (DatasetRid) – The dataset rid

  • branch (Ref) – The branch

Returns:

with dataset schema, that can be used to call upload_dataset_schema

Return type:

dict

Raises:

ValueError – if foundry schema inference failed

api_infer_dataset_schema(dataset_rid, branch, **kwargs)[source]#

Infer the dataset schema.

Parameters:
  • dataset_rid (DatasetRid) – the dataset rid to infer the schema

  • branch (Ref) – branch of the dataset

  • **kwargs – gets passed to APIClient.api_request()

Return type:

requests.Response