aminghadersohi opened a new pull request, #38128:
URL: https://github.com/apache/superset/pull/38128

   ### SUMMARY
   
   Fixes three sources of deprecation warnings that produce significant log 
noise in production:
   
   1. **`SADeprecationWarning` from `and_()` with no arguments** 
(`models/helpers.py:2417`)
      - `ExploreMixin.get_time_filter()` calls `and_(*l)` where `l` can be 
empty (when no time filters are applied)
      - Newer SQLAlchemy versions warn: *"Invoking and_() without arguments is 
deprecated"*
      - Fix: Use `and_(True, *l)` as recommended by SQLAlchemy — `True` is a 
no-op in AND clauses
   
   2. **`RemovedInMarshmallow4Warning` from `description=` keyword** 
(`db_engine_specs/databend.py`)
      - `DatabendParametersSchema` passes `description=` as a keyword argument 
to marshmallow fields
      - Marshmallow 4 requires `metadata={"description": ...}` instead
      - Fix: Migrate all field declarations to use the `metadata` dict
   
   3. **`DeprecatedWarning` spam from `get_subclasses`** (`viz.py:2820-2831`)
      - `get_subclasses()` is marked `@deprecated(deprecated_in="3.0")` but is 
called internally at module load time to build `viz_types`
      - This emits deprecation warnings on every process start (every worker, 
every restart)
      - Fix: Extract a private `_get_subclasses()` helper for internal use; 
keep deprecated public `get_subclasses()` for backward compatibility
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — backend log noise reduction
   
   ### TESTING INSTRUCTIONS
   1. Verify `get_time_filter()` still works when both `start_dttm` and 
`end_dttm` are `None` (no time filter)
   2. Verify `get_time_filter()` still works normally with time filters applied
   3. Verify Databend connection parameters still render correctly in the UI
   4. Verify `viz_types` dict is populated correctly (legacy viz types still 
available)
   5. Run existing tests: `pytest tests/unit_tests/models/ 
tests/unit_tests/db_engine_specs/`
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to