You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jfrag1 (via GitHub)" <gi...@apache.org> on 2023/02/01 06:38:31 UTC

[GitHub] [superset] jfrag1 opened a new pull request, #22931: chore: Migrate get_or_create_table endpoint to api v1

jfrag1 opened a new pull request, #22931:
URL: https://github.com/apache/superset/pull/22931

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Continues migration to the v1 API
   * Deprecates `/superset/get_or_create_table/`
   * Introduces a new endpoint, `/api/v1/datasource/table/get_or_create/`
   
   The new endpoint is essentially the same, but with several improvements including:
   * Better test coverage
   * Better error handling
   * Closer adherence to Superset API patterns
   * An OpenAPI spec
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dpgaspar commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "dpgaspar (via GitHub)" <gi...@apache.org>.
dpgaspar commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1093004151


##########
superset/datasource/api.py:
##########
@@ -35,6 +42,77 @@ class DatasourceRestApi(BaseSupersetApi):
     resource_name = "datasource"
     openapi_spec_tag = "Datasources"
 
+    openapi_spec_component_schemas = (GetOrCreateTableSchema,)
+
+    @expose("/table/get_or_create/", methods=["POST"])

Review Comment:
   a table here is a dataset, I think this should live on `/api/v1/dataset`, take a look at: https://github.com/apache/superset/blob/master/superset/datasets/commands/create.py#L57
   



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jfrag1 commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1100781471


##########
superset/datasets/commands/create.py:
##########
@@ -47,6 +48,7 @@ def run(self) -> Model:
             dataset = DatasetDAO.create(self._properties, commit=False)
             # Updates columns and metrics from the dataset
             dataset.fetch_metadata(commit=False)
+            create_table_permissions(dataset)

Review Comment:
   Oh you're right, I'm assuming that `create_table_permissions` came before that function but wasn't removed once `dataset_after_insert` made it unnecessary.  I've removed that function entirely from the codebase now, let me know if we should keep it though.



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jfrag1 commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1093545693


##########
superset/datasource/api.py:
##########
@@ -35,6 +42,77 @@ class DatasourceRestApi(BaseSupersetApi):
     resource_name = "datasource"
     openapi_spec_tag = "Datasources"
 
+    openapi_spec_component_schemas = (GetOrCreateTableSchema,)
+
+    @expose("/table/get_or_create/", methods=["POST"])

Review Comment:
   Thanks for the tip, I moved everything over to `/api/v1/dataset` and updated to use that existing command



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jfrag1 commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1100781643


##########
superset/datasets/api.py:
##########
@@ -877,3 +880,74 @@ def import_(self) -> Response:
         )
         command.run()
         return self.response(200, message="OK")
+
+    @expose("/get_or_create/", methods=["POST"])
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
+        f".get_or_create_dataset",
+        log_to_statsd=False,
+    )
+    def get_or_create_dataset(self) -> Response:
+        """Retrieve a dataset by name, or create it if it does not exist
+        ---
+        post:
+          summary: Retrieve a table by name, or create it if it does not exist
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/GetOrCreateDatasetSchema'
+          responses:
+            200:
+              description: The ID of the table
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      result:
+                        type: object
+                        properties:
+                          table_id:
+                            type: integer
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            422:
+              $ref: '#/components/responses/422'
+            500:
+              $ref: '#/components/responses/500'
+        """
+        try:
+            body = GetOrCreateDatasetSchema().load(request.json)
+        except ValidationError as ex:
+            return self.response(400, message=ex.messages)
+        table_name = body["table_name"]
+        database_id = body["database_id"]
+        table = (
+            db.session.query(SqlaTable)
+            .filter_by(database_id=database_id, table_name=table_name)
+            .one_or_none()
+        )

Review Comment:
   moved to DAO



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jfrag1 commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1100781471


##########
superset/datasets/commands/create.py:
##########
@@ -47,6 +48,7 @@ def run(self) -> Model:
             dataset = DatasetDAO.create(self._properties, commit=False)
             # Updates columns and metrics from the dataset
             dataset.fetch_metadata(commit=False)
+            create_table_permissions(dataset)

Review Comment:
   Oh you're right, I'm assuming that `create_table_permissions` came before that function but wasn't removed once `dataset_after_insert` made it unnecessary.  I've removed that function entirely now, let me know if we should keep it though.



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jfrag1 closed pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 closed pull request #22931: chore: Migrate get_or_create_table endpoint to api v1
URL: https://github.com/apache/superset/pull/22931


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by codecov.
codecov[bot] commented on PR #22931:
URL: https://github.com/apache/superset/pull/22931#issuecomment-1411547537

   # [Codecov](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#22931](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d703821) into [master](https://codecov.io/gh/apache/superset/commit/c839d0daf50af4e974572b3a261eae5582951bbd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c839d0d) will **decrease** coverage by `9.47%`.
   > The diff coverage is `77.50%`.
   
   > :exclamation: Current head d703821 differs from pull request most recent head 40a70ef. Consider uploading reports for the commit 40a70ef to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #22931      +/-   ##
   ==========================================
   - Coverage   65.81%   56.35%   -9.47%     
   ==========================================
     Files        1876     1879       +3     
     Lines       72086    72142      +56     
     Branches     7872     7864       -8     
   ==========================================
   - Hits        47447    40654    -6793     
   - Misses      22619    29468    +6849     
     Partials     2020     2020              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.72% <42.38%> (?)` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.62% <42.38%> (?)` | |
   | python | `59.11% <83.53%> (-19.74%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `52.41% <82.71%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...gin-chart-echarts/src/Sunburst/EchartsSunburst.tsx](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvRWNoYXJ0c1N1bmJ1cnN0LnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...plugin-chart-echarts/src/Sunburst/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvY29udHJvbFBhbmVsLnRzeA==) | `28.57% <ø> (ø)` | |
   | [...plugins/plugin-chart-echarts/src/Sunburst/index.ts](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvaW5kZXgudHM=) | `50.00% <ø> (+50.00%)` | :arrow_up: |
   | [...lugin-chart-echarts/src/Sunburst/transformProps.ts](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvdHJhbnNmb3JtUHJvcHMudHM=) | `0.00% <0.00%> (ø)` | |
   | [...plugins/plugin-chart-echarts/src/Sunburst/types.ts](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvdHlwZXMudHM=) | `100.00% <ø> (ø)` | |
   | [...ntend/plugins/plugin-chart-echarts/src/defaults.ts](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvZGVmYXVsdHMudHM=) | `100.00% <ø> (+80.00%)` | :arrow_up: |
   | [...lLab/components/ExploreCtasResultsButton/index.tsx](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0V4cGxvcmVDdGFzUmVzdWx0c0J1dHRvbi9pbmRleC50c3g=) | `8.33% <ø> (ø)` | |
   | [...frontend/src/SqlLab/components/SqlEditor/index.jsx](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvci9pbmRleC5qc3g=) | `56.45% <0.00%> (ø)` | |
   | [...components/DashboardBuilder/DashboardContainer.tsx](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEJ1aWxkZXIvRGFzaGJvYXJkQ29udGFpbmVyLnRzeA==) | `40.00% <ø> (ø)` | |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [384 more](https://codecov.io/gh/apache/superset/pull/22931?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dpgaspar commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "dpgaspar (via GitHub)" <gi...@apache.org>.
dpgaspar commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1098986991


##########
superset/datasets/api.py:
##########
@@ -877,3 +880,74 @@ def import_(self) -> Response:
         )
         command.run()
         return self.response(200, message="OK")
+
+    @expose("/get_or_create/", methods=["POST"])
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
+        f".get_or_create_dataset",
+        log_to_statsd=False,
+    )
+    def get_or_create_dataset(self) -> Response:
+        """Retrieve a dataset by name, or create it if it does not exist
+        ---
+        post:
+          summary: Retrieve a table by name, or create it if it does not exist
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/GetOrCreateDatasetSchema'
+          responses:
+            200:
+              description: The ID of the table
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      result:
+                        type: object
+                        properties:
+                          table_id:
+                            type: integer
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            422:
+              $ref: '#/components/responses/422'
+            500:
+              $ref: '#/components/responses/500'
+        """
+        try:
+            body = GetOrCreateDatasetSchema().load(request.json)
+        except ValidationError as ex:
+            return self.response(400, message=ex.messages)
+        table_name = body["table_name"]
+        database_id = body["database_id"]
+        table = (
+            db.session.query(SqlaTable)
+            .filter_by(database_id=database_id, table_name=table_name)
+            .one_or_none()
+        )

Review Comment:
   let's move this into the DAO.
   
   Or even create an `UpsertDatasetCommand` (optional)



##########
superset/datasets/api.py:
##########
@@ -877,3 +880,74 @@ def import_(self) -> Response:
         )
         command.run()
         return self.response(200, message="OK")
+
+    @expose("/get_or_create/", methods=["POST"])
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
+        f".get_or_create_dataset",
+        log_to_statsd=False,
+    )
+    def get_or_create_dataset(self) -> Response:
+        """Retrieve a dataset by name, or create it if it does not exist
+        ---
+        post:
+          summary: Retrieve a table by name, or create it if it does not exist
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/GetOrCreateDatasetSchema'
+          responses:
+            200:
+              description: The ID of the table
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      result:
+                        type: object
+                        properties:
+                          table_id:
+                            type: integer
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            422:
+              $ref: '#/components/responses/422'
+            500:
+              $ref: '#/components/responses/500'
+        """
+        try:
+            body = GetOrCreateDatasetSchema().load(request.json)
+        except ValidationError as ex:
+            return self.response(400, message=ex.messages)
+        table_name = body["table_name"]
+        database_id = body["database_id"]
+        table = (
+            db.session.query(SqlaTable)
+            .filter_by(database_id=database_id, table_name=table_name)
+            .one_or_none()
+        )
+        if not table:

Review Comment:
   nit: we could invert this `if` to improve readability:
   
   ``` python
   if table:
       return self.response(200, result={"table_id": table_id)
    
   body["database"] = database_id
   try:
       table = CreateDatasetCommand(body).run()
   except DatasetInvalidError as ex:
       return self.response_422(message=ex.normalized_messages())
   except DatasetCreateFailedError as ex:
       logger.error(
           "Error creating model %s: %s",
           self.__class__.__name__,
           str(ex),
           exc_info=True,
       )
       return self.response_422(message=ex.message)
   ```
   
       
       



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dpgaspar commented on a diff in pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "dpgaspar (via GitHub)" <gi...@apache.org>.
dpgaspar commented on code in PR #22931:
URL: https://github.com/apache/superset/pull/22931#discussion_r1100407259


##########
superset/datasets/commands/create.py:
##########
@@ -47,6 +48,7 @@ def run(self) -> Model:
             dataset = DatasetDAO.create(self._properties, commit=False)
             # Updates columns and metrics from the dataset
             dataset.fetch_metadata(commit=False)
+            create_table_permissions(dataset)

Review Comment:
   aren't these being created on `security_manager.dataset_after_insert` ?



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dpgaspar merged pull request #22931: chore: Migrate get_or_create_table endpoint to api v1

Posted by "dpgaspar (via GitHub)" <gi...@apache.org>.
dpgaspar merged PR #22931:
URL: https://github.com/apache/superset/pull/22931


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org