Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Fix causing program to not display error message in save dataframe #531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anthonywainer
Copy link

This commit fixes a bug that caused the program to not display an error message when saving a Spark dataframe to Snowflake. The problem was related to exception catching, which did not display errors that occurred during the save process. As a result, users were unaware of any issues with the saved data and could not take appropriate action to fix them.

To solve this problem, we have added an error handling code to the programme that detects any errors that occur during the saving process and displays an appropriate error message to the user.

With this fix, users can be confident that any errors that occur during the save process will be correctly reported, allowing them to quickly identify and fix any problems with the saved data.

Example:

column_name data_type
id int
execution_date timestamp
from pyspark.sql.functions import col
df = spark.createDataFrame(
    [{"id": 1, "execution_date": "202022-02-23 19:21:06"}]
).withColumn("execution_date", col("execution_date").cast("timestamp"))

df.show(truncate=False)

df.write.save(
    format="snowflake",
    mode="append",
)

error: the error is not displayed
image

solution: the error is displayed
image

@anthonywainer
Copy link
Author

@sfc-gh-bli could you check this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant