Addresses codeant-ai bot review threads asking for explicit type hints
on the datetime variables introduced by the utcnow() replacement.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Python 3.12 deprecated datetime.utcnow() and datetime.utcfromtimestamp().
This sweeps all production occurrences under superset/ (8 files) and replaces
them with behavior-preserving equivalents that keep the existing naive-UTC
semantics:
datetime.utcnow() -> datetime.now(timezone.utc).replace(tzinfo=None)
datetime.utcfromtimestamp(x) -> datetime.fromtimestamp(x, timezone.utc).replace(tzinfo=None)
Keeping the values naive (rather than switching to aware datetimes) avoids
naive/aware comparison errors against timestamps already stored naive in the
metadata DB (e.g. the Log.dttm prune query on PostgreSQL) and keeps
isoformat()/cache-key output byte-identical. This is the key difference from
the earlier #37538, which switched to aware datetimes.
superset/security/session_invalidation.py already uses now(timezone.utc) and
is left unchanged. Test files still use the deprecated calls and can be
migrated in a focused follow-up.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Async queries: remove force cache param on data retrieval
* Assert equal query_object cache keys
* Decouple etag_cache from permission checks
* Fix query_context test
* Use marshmallow EnumField for validation
* feat: rename TABLE_NAMES_CACHE_CONFIG to DATA_CACHE_CONFIG
The corresponding cache will now also cache the query results.
* Slice use DATA_CACHE_CONFIG CACHE_DEFAULT_TIMEOUT
* Add test for default cache timeout
* rename FAR_FUTURE to ONE_YEAR_IN_SECS
* Updated pylint in cache.py in utils: unecessary bad-whitespace. Autoformatting
* Updated pylint in core.py in utils: E0202.
* Updated pylint in logging_configurator.py in utils: disable=no-member. Formatting
* Updated pylint in machine_auth.py in utils: unused-import
* Updated pylint in screenshots.py in utils: unused-import and import-error
* Updated pylint in webdriver.py in utils: unused-import
* First cut at app factory
* Setting things back to master
* Working with new FLASK_APP
* Still need to refactor Celery
* CLI mostly working
* Working on unit tests
* Moving cli stuff around a bit
* Removing get in config
* Defaulting test config
* Adding flask-testing
* flask-testing casing
* resultsbackend property bug
* Fixing up cli
* Quick fix for KV api
* Working on save slice
* Fixed core_tests
* Fixed utils_tests
* Most tests working - still need to dig into remaining app_context issue in tests
* All tests passing locally - need to update code comments
* Fixing dashboard tests again
* Blacking
* Sorting imports
* linting
* removing envvar mangling
* blacking
* Fixing unit tests
* isorting
* licensing
* fixing mysql tests
* fixing cypress?
* fixing .flaskenv
* fixing test app_ctx
* fixing cypress
* moving manifest processor around
* moving results backend manager around
* Cleaning up __init__ a bit more
* Addressing PR comments
* Addressing PR comments
* Blacking
* Fixes for running celery worker
* Tuning isort
* Blacking
* [utils] gathering/refactoring into a "utils/" folder
Moving current utils.py into utils/core.py and moving other *util*
modules under this new "utils/" as well.
Following steps include eroding at "utils/core.py" and breaking it down
into smaller modules.
* Improve tests
* Make loading examples in scope for tests
* Remove test class attrs examples_loaded and requires_examples