Skip to content

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.

Nov. 18, 2024