dwreeves commented on code in PR #62378:
URL: https://github.com/apache/airflow/pull/62378#discussion_r2848241791


##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py:
##########
@@ -411,7 +411,17 @@ def _get_static_conn_params(self) -> dict[str, str | None]:
                 raise ValueError("The private_key_file size is too big. Please 
keep it less than 4 KB.")
             private_key_pem = Path(private_key_file_path).read_bytes()
         elif private_key_content:
-            private_key_pem = base64.b64decode(private_key_content)
+            if any(

Review Comment:
   Updated.
   
   I didn't use the private method, instead I just did a try-except directly.
   
   The upside of direct try-except is this prevents repeated work-- extremely 
minor repeated work, but still-- and keeps the control flow self-contained.
   
   The downside is it makes the traceback slightly more annoying to parse 
through, and it's probably not terribly uncommon for users to hit a b64encoding 
error here so this longer error traceback will be user facing (albeit, the 
traceback is arguably more informative, so not necessarily even a downside!).
   
   Let me know if you think it should be its own method. If you're OK with it 
not being one, then this is complete.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to