willbarrett commented on a change in pull request #13282:
URL: https://github.com/apache/superset/pull/13282#discussion_r580647080
##########
File path: tests/core_tests.py
##########
@@ -508,13 +513,7 @@ def test_testconn_failed_conn(self, username="admin"):
expected_body,
)
- data = json.dumps(
- {
- "uri": "mssql+pymssql://url",
- "name": "examples",
- "impersonate_user": False,
- }
- )
+ data = bad_database_test_conn_request()
Review comment:
This could become a true Pytest fixture
##########
File path: tests/core_tests.py
##########
@@ -892,68 +891,7 @@ def test_explore_json(self):
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_explore_json_dist_bar_order(self):
tbl_id = self.table_ids.get("birth_names")
- form_data = {
- "datasource": f"{tbl_id}__table",
- "viz_type": "dist_bar",
- "url_params": {},
- "time_range_endpoints": ["inclusive", "exclusive"],
- "granularity_sqla": "ds",
- "time_range": 'DATEADD(DATETIME("2021-01-22T00:00:00"), -100,
year) : 2021-01-22T00:00:00',
- "metrics": [
- {
- "expressionType": "SIMPLE",
- "column": {
- "id": 334,
- "column_name": "name",
- "verbose_name": "null",
- "description": "null",
- "expression": "",
- "filterable": True,
- "groupby": True,
- "is_dttm": False,
- "type": "VARCHAR(255)",
- "python_date_format": "null",
- },
- "aggregate": "COUNT",
- "sqlExpression": "null",
- "isNew": False,
- "hasCustomLabel": False,
- "label": "COUNT(name)",
- "optionName": "metric_xdzsijn42f9_khi4h3v3vci",
- },
- {
- "expressionType": "SIMPLE",
- "column": {
- "id": 332,
- "column_name": "ds",
- "verbose_name": "null",
- "description": "null",
- "expression": "",
- "filterable": True,
- "groupby": True,
- "is_dttm": True,
- "type": "TIMESTAMP WITHOUT TIME ZONE",
- "python_date_format": "null",
- },
- "aggregate": "COUNT",
- "sqlExpression": "null",
- "isNew": False,
- "hasCustomLabel": False,
- "label": "COUNT(ds)",
- "optionName": "metric_80g1qb9b6o7_ci5vquydcbe",
- },
- ],
- "adhoc_filters": [],
- "groupby": ["name"],
- "columns": [],
- "row_limit": 10,
- "color_scheme": "supersetColors",
- "label_colors": {},
- "show_legend": True,
- "y_axis_format": "SMART_NUMBER",
- "bottom_margin": "auto",
- "x_ticks_layout": "auto",
- }
+ form_data = dist_bar_form_data(table_id=tbl_id)
Review comment:
This could be moved to a Pytest fixture that performs the load on the
previous line
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]