Skip to content

SNOW-228474: Support converting VARIANT to python object  #544

@roi-meir

Description

@roi-meir

What is the current behavior?

When querying a variant (or array and object) column the results are returned as dumped json string.
In the past before the Arrow format support we used the converter_class parameter to pass our own subclass of SnowflakeConverter that calls json.loads on the returned string.
But when using the Arrow format this parameter has no affect

What is the desired behavior?

To be able to control if the results should be a string or a python object (list or dict)

How would this improve snowflake-connector-python?

Either have a way to pass a costume converter class or have another parameter that call json.loads

I will be happy to open a pull request that adds the parameter convert_arrow_variant_to_object that if enabled, call json.loads on variant results.

References, Other Background

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurestatus-triage_doneInitial triage done, will be further handled by the driver team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions