Comments (3)
To resolve the 500 error and the unexpected keyword argument 'extra_filters' issue, follow these steps:
-
Check Superset Configuration:
Ensure thatDEBUG
mode is set toFalse
in your Superset configuration. This affects error handling behavior. -
Review Error Handling Code:
The error handling code insuperset/views/base.py
handles different exceptions and returns appropriate responses. For HTTP 500 errors, it serves a static HTML file ifDEBUG
isFalse
. -
Verify Static Assets:
Ensure the static HTML file for the 500 error exists atstatic/assets/500.html
:path = files("superset") / "static/assets/500.html" return send_file(path, max_age=0), 500
-
Enable Stacktrace for Debugging:
Temporarily enable stacktrace in the configuration to get more details about the error:def get_error_msg() -> str: if conf.get("SHOW_STACKTRACE"): error_msg = traceback.format_exc() else: error_msg = "FATAL ERROR \n" error_msg += ( "Stacktrace is hidden. Change the SHOW_STACKTRACE " "configuration setting to enable it" ) return error_msg
-
Check Logs:
Review the logs for warnings or exceptions that might provide more context about the 500 error:logger.warning("HTTPException", exc_info=True) logger.exception(ex)
-
Return JSON Error Response:
Ensure the JSON error response is returned correctly if the request is not for HTML:return json_errors_response( errors=[ SupersetError( message=utils.error_msg_from_exception(ex), error_type=SupersetErrorType.GENERIC_BACKEND_ERROR, level=ErrorLevel.ERROR, ), ], status=ex.code or 500, )
Additionally, there have been recent updates in the flask
and flask_wtf
libraries that could affect form handling:
flask
updated to version 2.2.5flask_wtf
updated to version 1.1.0
Review the release notes for these versions to identify specific changes that could impact the LoginForm_db
class [1][2].
Finally, ensure your superset/config.py
file has the correct configurations for CSRF protection:
- WTF_CSRF_ENABLED:
WTF_CSRF_ENABLED = True
- WTF_CSRF_EXEMPT_LIST:
WTF_CSRF_EXEMPT_LIST = [ "superset.views.core.log", "superset.views.core.explore_json", "superset.charts.data.api.data", ]
- WTF_CSRF_TIME_LIMIT:
WTF_CSRF_TIME_LIMIT = int(timedelta(weeks=1).total_seconds())
These configurations control CSRF protection settings, which directly impact how LoginForm_db
interacts with wtforms
and flask_wtf
[3].
To continue talking to Dosu, mention @dosu.
from superset.
The extra_filters
argument is used in the getFormDataWithExtraFilters
function to handle additional filters applied to charts in Superset. This function processes the extra_filters
argument to generate the necessary form data for rendering charts.
Here's an example of how getFormDataWithExtraFilters
is used:
export default function getFormDataWithExtraFilters({
chart,
filters,
nativeFilters,
chartConfiguration,
colorScheme,
colorNamespace,
sliceId,
dataMask,
extraControls,
labelColors,
sharedLabelColors,
allSliceIds,
}: GetFormDataWithExtraFiltersArguments) {
// if dashboard metadata + filters have not changed, use cache if possible
const cachedFormData = cachedFormdataByChart[sliceId];
if (
cachedFiltersByChart[sliceId] === filters &&
areObjectsEqual(cachedFormData?.color_scheme, colorScheme, {
ignoreUndefined: true,
}) &&
areObjectsEqual(cachedFormData?.color_namespace, colorNamespace, {
ignoreUndefined: true,
}) &&
areObjectsEqual(cachedFormData?.label_colors, labelColors, {
ignoreUndefined: true,
}) &&
areObjectsEqual(cachedFormData?.shared_label_colors, sharedLabelColors, {
ignoreUndefined: true,
}) &&
!!cachedFormData &&
areObjectsEqual(cachedFormData?.dataMask, dataMask, {
ignoreUndefined: true,
}) &&
areObjectsEqual(cachedFormData?.extraControls, extraControls, {
ignoreUndefined: true,
})
) {
return cachedFormData;
}
let extraData: { extra_form_data?: JsonObject } = {};
const activeFilters = getAllActiveFilters({
chartConfiguration,
dataMask,
nativeFilters,
allSliceIds,
});
const filterIdsAppliedOnChart = Object.entries(activeFilters)
.filter(([, { scope }]) => scope.includes(chart.id))
.map(([filterId]) => filterId);
if (filterIdsAppliedOnChart.length) {
extraData = {
extra_form_data: getExtraFormData(dataMask, filterIdsAppliedOnChart),
};
}
const formData = {
...chart.form_data,
label_colors: labelColors,
shared_label_colors: sharedLabelColors,
...(colorScheme && { color_scheme: colorScheme }),
extra_filters: getEffectiveExtraFilters(filters),
...extraData,
...extraControls,
};
cachedFiltersByChart[sliceId] = filters;
cachedFormdataByChart[sliceId] = { ...formData, dataMask, extraControls };
return formData;
}
Ensure that the getFormDataWithExtraFilters
function is correctly defined and used in your codebase. If the function is not handling the extra_filters
argument properly, you may need to update it to ensure it processes the extra_filters
argument as expected [1].
To continue talking to Dosu, mention @dosu.
from superset.
@dosu I think the issue is with monkey_patch_field_process.<locals>.process() got an unexpected keyword argument 'extra_filters'
. Any idea what that argument is?
from superset.
Related Issues (20)
- Failed to setup alerts and reports based pypi installation HOT 6
- 4.0.1: Alerting and reports does not take EMAIL RECIPIENTS* HOT 4
- Filter does not follow label HOT 1
- [SIP-138] Proposal for Slack file upload V2 integration for Alerts and Reports HOT 3
- [SIP-139] Proposal for Ant Design 5.x Upgrade HOT 4
- On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB HOT 1
- build fails when using docker compose up HOT 7
- Blank Charts while loading dashboard HOT 2
- Warning when upgrading DB HOT 1
- sqlalchemy.exc.ArgumentError HOT 1
- Oracle as Metadata- Not working HOT 2
- Thumbnails work for Dashboards, not for charts HOT 1
- Unable to set role permissions for new schema unless a new connection is created. HOT 1
- Superset Login Redirect After Guest Token Usage in Angular Iframe HOT 1
- start of production no possible due to errors in docker-compose-non-dev.yml and docker/.env HOT 3
- Data Misalignment When Applying Filter HOT 5
- PLAYWRIGHT_REPORTS_AND_THUMBNAILS grey output for dashboards HOT 4
- Superset 3.1.3: Long Dashboards render blank thumbnails unless Dashboard length is reduced HOT 4
- Changing to non-temporal variable, then back, causes time grain to no longer function in 4.0.2rc2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.