kaxil commented on code in PR #73273:
URL: https://github.com/apache/airflow/pull/73273#discussion_r4036949846


##########
providers/common/sql/src/airflow/providers/common/sql/config.py:
##########
@@ -93,6 +96,10 @@ def __post_init__(self):
                 raise ValueError(f"Database name must be provided for table 
providers {TABLE_PROVIDERS}")
             return
 
+        if not self.format and not self.uri:
+            # Plain database table: no object store involved, so storage_type 
stays unset.
+            return

Review Comment:
   Hoisting the check above this branch closes all three accepted cases, and 
keeps the message that the two existing assertions match:
   
   ```suggestion
           if not self.table_name or not self.table_name.strip():
               raise ValueError("Table name must be provided for storage type")
   
           if not self.format and not self.uri:
               # Plain database table: no object store involved, so 
storage_type stays unset.
               return
   ```
   
   The check at line 106 can then go, since `table_name` is guaranteed 
non-blank by the time control reaches it, and its `storage_type is not None` 
guard was already vacuous: `_extract_storage_type` either returns a type or 
raises.
   
   Verified on top of this head: the three accepted cases raise, the `uri`-set 
case keeps raising, and the full `common.sql` and `common.ai` unit suites pass.
   



-- 
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