snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

SNOW-872017: Add wrapper function to encapsulate the result from write_pandas into a dataclass

Open DJ-DropTable opened this issue 1 year ago • 2 comments

What is the current behavior?

Currently, the result of write_pandas is tuple with multiple data types.

What is the desired behavior?

Addition of a new function that maps the result tuple to a dataclass with named attributes.

@dataclass
class WritePandasResult:
    success: bool
    num_chunks: int
    num_rows: int
    output: Sequence

How would this improve snowflake-connector-python?

Improve the readability of the existing code. This type of change would allow for the code to be self documenting in place of digging through the documentation to determine the purpose of each element of the tuple.

References and other background

No response

DJ-DropTable avatar Jul 19 '23 17:07 DJ-DropTable

This is a good suggestion and we will work on it in the future. If you are willing to help, please create a PR and we would review and merge it for you

sfc-gh-aalam avatar Jul 19 '23 19:07 sfc-gh-aalam

@sfc-gh-aalam do you know if you require DCO or CLA when submitting a PR?

DJ-DropTable avatar Jul 20 '23 15:07 DJ-DropTable