Compare commits

...
Author SHA1 Message Date
Elizabeth Thompson 086713d1ab fix: downgrade deprecated query_object field warnings to info
Charts saved with the old field names (groupby, granularity_sqla,
timeseries_limit, timeseries_limit_metric, extras where/having) hit
these log calls on every render until the chart is resaved, so a
warning repeats indefinitely with nothing new to report each time.
Same rationale already applied to _get_post_processing's unsupported-
option warning in this file.
2026-08-25 16:06:12 +00:00
+8 -4
View File
@@ -323,9 +323,12 @@ class QueryObject: # pylint: disable=too-many-instance-attributes
def _rename_deprecated_fields(self, kwargs: dict[str, Any]) -> None:
# rename deprecated fields
# Logged at info: a chart saved before the field was renamed hits this
# on every render, so a warning would repeat for as long as the chart
# is not resaved, without anything new to report.
for field in DEPRECATED_FIELDS:
if field.old_name in kwargs:
logger.warning(
logger.info(
"The field `%s` is deprecated, please use `%s` instead.",
field.old_name,
field.new_name,
@@ -333,7 +336,7 @@ class QueryObject: # pylint: disable=too-many-instance-attributes
value = kwargs[field.old_name]
if value:
if hasattr(self, field.new_name):
logger.warning(
logger.info(
"The field `%s` is already populated, "
"replacing value with contents from `%s`.",
field.new_name,
@@ -343,9 +346,10 @@ class QueryObject: # pylint: disable=too-many-instance-attributes
def _move_deprecated_extra_fields(self, kwargs: dict[str, Any]) -> None:
# move deprecated extras fields to extras
# Logged at info: same rationale as `_rename_deprecated_fields` above.
for field in DEPRECATED_EXTRAS_FIELDS:
if field.old_name in kwargs:
logger.warning(
logger.info(
"The field `%s` is deprecated and should "
"be passed to `extras` via the `%s` property.",
field.old_name,
@@ -354,7 +358,7 @@ class QueryObject: # pylint: disable=too-many-instance-attributes
value = kwargs[field.old_name]
if value:
if hasattr(self.extras, field.new_name):
logger.warning(
logger.info(
"The field `%s` is already populated in "
"`extras`, replacing value with contents "
"from `%s`.",