comet_ml.integration.snowflake ¶
get_artifact_v1 ¶
get_artifact_v1(
experiment, artifact_name, workspace=None, version_or_alias=None
)
Get the SQL query for a Snowflake Artifact.
Parameters:
experiment
(Experiment
) –Instance of Experiment object.
artifact_name
(str
) –Artifact name.
workspace
(str
, default:None
) –Retrieve an artifact belonging to that workspace.
version_or_alias
(Iterable[str]
, default:None
) –Retrieve the artifact by the given alias or version.
log_artifact_v1 ¶
log_artifact_v1(
experiment,
artifact_name,
sql,
sample=None,
sample_size=100,
url=None,
artifact_version=None,
artifact_aliases=None,
)
Logs a Snowflake Artifact to Comet based on a SQL query and a sample Pandas DataFrame.
Parameters:
experiment
(Experiment
) –Instance of an Experiment used to log the Artifact.
artifact_name
(str
) –The name of the Artifact to create.
sql
(str
) –The SQL used to generate the Snowflake dataset.
sample
(Pandas DataFrame
, default:None
) –Sample of the data generated by the SQL query defined previously.
sample_size
(int
, default:100
) –Number of rows to record from the sample dataframe defined previously. Defaults to 100.
artifact_version
(str
, default:None
) –Version of the artifact. If none is provided Comet will auto-increment the version.
artifact_aliases
(Iterable[str]
, default:None
) –Aliases to associate with the Artifact.
log_snowpark_dataframe_v1 ¶
log_snowpark_dataframe_v1(
experiment,
artifact_name,
dataframe,
artifact_version=None,
artifact_aliases=None,
log_sample=False,
sample_size=10,
)
Logs a Snowpark Dataframe as a Snowflake Artifact to Comet. The full dataset is not saved in Comet, instead we record both the SQL query and a small preview sample.
Parameters:
experiment
(Experiment
) –Instance of an Experiment used to log the Artifact.
artifact_name
(str
) –The name of the Artifact to create.
dataframe
(Snowpark Dataframe
) –The Snowpark Dataframe to record.
artifact_version
(str
, default:None
) –Version of the artifact. If none is provided Comet will auto-increment the version
artifact_aliases
(Iterable[str]
, default:None
) –Aliases to associate with the Artifact
log_sample
(bool
, default:False
) –Whether a preview of the dataset should be saved to the Comet platform.
sample_size
(int
, default:10
) –Number of rows to record from the sample dataframe defined previously.