etr2460 commented on a change in pull request #12080:
URL: 
https://github.com/apache/incubator-superset/pull/12080#discussion_r545259781



##########
File path: 
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx
##########
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { t } from '@superset-ui/core';
+
+import { ErrorMessageComponentProps } from './types';
+import IssueCode from './IssueCode';
+import ErrorAlert from './ErrorAlert';
+
+interface ParameterErrorExtra {
+  owners?: string[];
+  issue_codes: {
+    code: number;
+    message: string;
+  }[];
+  engine_name: string | null;
+}
+
+function ParameterErrorMessage({
+  error,
+  source = 'dashboard',

Review comment:
       if these are SQL Lab errors, should `source` be `sql_lab`?

##########
File path: 
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx
##########
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { t } from '@superset-ui/core';
+
+import { ErrorMessageComponentProps } from './types';
+import IssueCode from './IssueCode';
+import ErrorAlert from './ErrorAlert';
+
+interface ParameterErrorExtra {
+  owners?: string[];
+  issue_codes: {
+    code: number;
+    message: string;
+  }[];
+  engine_name: string | null;
+}
+
+function ParameterErrorMessage({
+  error,
+  source = 'dashboard',
+}: ErrorMessageComponentProps<ParameterErrorExtra>) {
+  const { extra, level, message } = error;
+
+  const body = (
+    <>
+      <p>
+        {t('This may be triggered by:')}

Review comment:
       tiny nit: should we make the output of this translation function a 
constant that can be used here and on line 54?

##########
File path: 
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx
##########
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { t } from '@superset-ui/core';
+
+import { ErrorMessageComponentProps } from './types';
+import IssueCode from './IssueCode';
+import ErrorAlert from './ErrorAlert';
+
+interface ParameterErrorExtra {
+  owners?: string[];
+  issue_codes: {
+    code: number;
+    message: string;
+  }[];
+  engine_name: string | null;

Review comment:
       It makes sense that we wouldn't have either of them too I think, since 
this error message comes from SQL Lab, where ownership is kinda fuzzy, and the 
error is returned before the query actually gets run, so the engine doesn't 
matter

##########
File path: 
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx
##########
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { t } from '@superset-ui/core';
+
+import { ErrorMessageComponentProps } from './types';
+import IssueCode from './IssueCode';
+import ErrorAlert from './ErrorAlert';
+
+interface ParameterErrorExtra {
+  owners?: string[];
+  issue_codes: {
+    code: number;
+    message: string;
+  }[];
+  engine_name: string | null;

Review comment:
       I don't see `owners` or `engine_name` being used in the renderer, so we 
probably don't need them in the `Extra` section?




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

Reply via email to