You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/16 18:27:56 UTC
[GitHub] [superset] betodealmeida opened a new pull request #19217: feat: import/export assets commands
betodealmeida opened a new pull request #19217:
URL: https://github.com/apache/superset/pull/19217
<!---
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 -->
This PR introduces two new commands (`ImportAssetsCommand` and `ExportAssetsCommand`). The commands will be used to export all assets from Superset into a ZIP file, as well as back into Superset, with the objective of managing the assets from source control.
Depends on https://github.com/apache/superset/pull/19216.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
N/A
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
Added unit tests.
### 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] betodealmeida commented on a change in pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
betodealmeida commented on a change in pull request #19217:
URL: https://github.com/apache/superset/pull/19217#discussion_r829335428
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
Thanks for the suggestion! There's a subtle difference here that I want to capture; if `passwords` is passed as a keyword argument and is falsy (most likely `None`) we want it to be a dict, which is why I did the pattern with `or` instead of `.get`.
--
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 #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa9df9b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `0.04%`.
> The diff coverage is `25.00%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
==========================================
- Coverage 52.08% 52.03% -0.05%
==========================================
Files 1665 1667 +2
Lines 64139 64247 +108
Branches 6484 6484
==========================================
+ Hits 33406 33433 +27
- Misses 29052 29133 +81
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <25.00%> (-0.10%)` | :arrow_down: |
| presto | `52.40% <25.00%> (-0.10%)` | :arrow_down: |
| python | `52.82% <25.00%> (-0.10%)` | :arrow_down: |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.53% <32.53%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...aa9df9b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6b8956b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `24.77%`.
> :exclamation: Current head 6b8956b differs from pull request most recent head c532d79. Consider uploading reports for the commit c532d79 to get more accurate results
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64248 +26
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29134 +9442
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| javascript | `51.26% <ø> (ø)` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `52.82% <24.77%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.14% <32.14%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...c532d79](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6b8956b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `24.77%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64248 +26
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29134 +9442
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| javascript | `51.26% <ø> (ø)` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `52.82% <24.77%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.14% <32.14%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...6b8956b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] betodealmeida merged pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
betodealmeida merged pull request #19217:
URL: https://github.com/apache/superset/pull/19217
--
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] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c532d79) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **increase** coverage by `0.03%`.
> The diff coverage is `88.07%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
==========================================
+ Coverage 66.72% 66.75% +0.03%
==========================================
Files 1667 1669 +2
Lines 64222 64331 +109
Branches 6484 6484
==========================================
+ Hits 42849 42942 +93
- Misses 19692 19708 +16
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| mysql | `81.98% <88.07%> (+0.02%)` | :arrow_up: |
| postgres | `82.02% <88.07%> (+0.01%)` | :arrow_up: |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `82.44% <88.07%> (+<0.01%)` | :arrow_up: |
| sqlite | `81.78% <88.07%> (+0.02%)` | :arrow_up: |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `85.71% <85.71%> (ø)` | |
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `96.00% <96.00%> (ø)` | |
| [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `92.20% <0.00%> (-1.30%)` | :arrow_down: |
| [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `95.13% <0.00%> (-0.55%)` | :arrow_down: |
| [superset/reports/commands/execute.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9leGVjdXRlLnB5) | `91.14% <0.00%> (-0.37%)` | :arrow_down: |
| [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <0.00%> (+0.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...c532d79](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c532d79) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **increase** coverage by `0.03%`.
> The diff coverage is `88.07%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
==========================================
+ Coverage 66.72% 66.75% +0.03%
==========================================
Files 1667 1669 +2
Lines 64222 64331 +109
Branches 6484 6484
==========================================
+ Hits 42849 42946 +97
- Misses 19692 19704 +12
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| mysql | `81.98% <88.07%> (+0.02%)` | :arrow_up: |
| postgres | `82.03% <88.07%> (+0.02%)` | :arrow_up: |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `82.45% <88.07%> (+0.02%)` | :arrow_up: |
| sqlite | `81.78% <88.07%> (+0.02%)` | :arrow_up: |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `85.71% <85.71%> (ø)` | |
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `96.00% <96.00%> (ø)` | |
| [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <0.00%> (+0.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...c532d79](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa9df9b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `25.00%`.
> :exclamation: Current head aa9df9b differs from pull request most recent head 6b8956b. Consider uploading reports for the commit 6b8956b to get more accurate results
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64247 +25
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29133 +9441
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <25.00%> (-0.10%)` | :arrow_down: |
| javascript | `51.26% <ø> (ø)` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <25.00%> (-0.10%)` | :arrow_down: |
| python | `52.82% <25.00%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.53% <32.53%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...6b8956b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] betodealmeida merged pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
betodealmeida merged pull request #19217:
URL: https://github.com/apache/superset/pull/19217
--
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] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c532d79) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `24.77%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64248 +26
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29134 +9442
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `52.82% <24.77%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.14% <32.14%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...c532d79](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c532d79) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **increase** coverage by `0.03%`.
> The diff coverage is `88.07%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
==========================================
+ Coverage 66.72% 66.75% +0.03%
==========================================
Files 1667 1669 +2
Lines 64222 64331 +109
Branches 6484 6484
==========================================
+ Hits 42849 42943 +94
- Misses 19692 19705 +13
- Partials 1681 1683 +2
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| javascript | `51.25% <ø> (-0.01%)` | :arrow_down: |
| mysql | `81.98% <88.07%> (+0.02%)` | :arrow_up: |
| postgres | `82.03% <88.07%> (+0.02%)` | :arrow_up: |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `82.45% <88.07%> (+0.02%)` | :arrow_up: |
| sqlite | `81.78% <88.07%> (+0.02%)` | :arrow_up: |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `85.71% <85.71%> (ø)` | |
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `96.00% <96.00%> (ø)` | |
| [...eFilters/FiltersConfigModal/FiltersConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyc0NvbmZpZ01vZGFsL0ZpbHRlcnNDb25maWdNb2RhbC50c3g=) | `63.04% <0.00%> (-1.64%)` | :arrow_down: |
| [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <0.00%> (+0.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...c532d79](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] hughhhh commented on a change in pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #19217:
URL: https://github.com/apache/superset/pull/19217#discussion_r829257361
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
--
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] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa9df9b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `25.00%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64247 +25
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29133 +9441
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <25.00%> (-0.10%)` | :arrow_down: |
| javascript | `51.26% <ø> (ø)` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <25.00%> (-0.10%)` | :arrow_down: |
| python | `52.82% <25.00%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.53% <32.53%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...aa9df9b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa9df9b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `0.04%`.
> The diff coverage is `25.00%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
==========================================
- Coverage 52.08% 52.03% -0.05%
==========================================
Files 1665 1667 +2
Lines 64139 64247 +108
Branches 6484 6484
==========================================
+ Hits 33406 33433 +27
- Misses 29052 29133 +81
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <25.00%> (-0.10%)` | :arrow_down: |
| presto | `52.40% <25.00%> (-0.10%)` | :arrow_down: |
| python | `52.82% <25.00%> (-0.10%)` | :arrow_down: |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.53% <32.53%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...aa9df9b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] codecov[bot] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
--
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] edited a comment on pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #19217:
URL: https://github.com/apache/superset/pull/19217#issuecomment-1069801154
# [Codecov](https://codecov.io/gh/apache/superset/pull/19217?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 [#19217](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6b8956b) into [master](https://codecov.io/gh/apache/superset/commit/a4848a2f46fdcd86e4f66343bba80838e4de4c82?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4848a2) will **decrease** coverage by `14.68%`.
> The diff coverage is `24.77%`.
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
===========================================
- Coverage 66.72% 52.03% -14.69%
===========================================
Files 1667 1667
Lines 64222 64248 +26
Branches 6484 6484
===========================================
- Hits 42849 33433 -9416
- Misses 19692 29134 +9442
Partials 1681 1681
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `52.55% <24.77%> (-0.10%)` | :arrow_down: |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.40% <24.77%> (-0.10%)` | :arrow_down: |
| python | `52.82% <24.77%> (-29.62%)` | :arrow_down: |
| sqlite | `?` | |
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/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/commands/export/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvZXhwb3J0L2Fzc2V0cy5weQ==) | `0.00% <0.00%> (ø)` | |
| [superset/commands/importers/v1/assets.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2Fzc2V0cy5weQ==) | `32.14% <32.14%> (ø)` | |
| [superset/tables/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL3NjaGVtYXMucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/columns/schemas.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29sdW1ucy9zY2hlbWFzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `22.22% <0.00%> (-77.78%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `14.79% <0.00%> (-75.15%)` | :arrow_down: |
| [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `17.50% <0.00%> (-75.00%)` | :arrow_down: |
| [superset/tasks/alerts/observer.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFza3MvYWxlcnRzL29ic2VydmVyLnB5) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| [superset/databases/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `27.77% <0.00%> (-72.23%)` | :arrow_down: |
| ... and [294 more](https://codecov.io/gh/apache/superset/pull/19217/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a4848a2...6b8956b](https://codecov.io/gh/apache/superset/pull/19217?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] hughhhh commented on a change in pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #19217:
URL: https://github.com/apache/superset/pull/19217#discussion_r829257361
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
--
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] hughhhh commented on a change in pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #19217:
URL: https://github.com/apache/superset/pull/19217#discussion_r829257361
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
```suggestion
self.passwords: Dict[str, str] = kwargs.get("passwords", {})
```
--
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] betodealmeida commented on a change in pull request #19217: feat: import/export assets commands
Posted by GitBox <gi...@apache.org>.
betodealmeida commented on a change in pull request #19217:
URL: https://github.com/apache/superset/pull/19217#discussion_r829335428
##########
File path: superset/commands/importers/v1/assets.py
##########
@@ -0,0 +1,164 @@
+# 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.
+from typing import Any, Dict, List, Optional, Tuple
+
+from marshmallow import Schema
+from marshmallow.exceptions import ValidationError
+from sqlalchemy.orm import Session
+from sqlalchemy.sql import select
+
+from superset import db
+from superset.charts.commands.importers.v1.utils import import_chart
+from superset.charts.schemas import ImportV1ChartSchema
+from superset.commands.base import BaseCommand
+from superset.commands.exceptions import CommandInvalidError, ImportFailedError
+from superset.commands.importers.v1.utils import (
+ load_configs,
+ load_metadata,
+ validate_metadata_type,
+)
+from superset.dashboards.commands.importers.v1.utils import (
+ find_chart_uuids,
+ import_dashboard,
+ update_id_refs,
+)
+from superset.dashboards.schemas import ImportV1DashboardSchema
+from superset.databases.commands.importers.v1.utils import import_database
+from superset.databases.schemas import ImportV1DatabaseSchema
+from superset.datasets.commands.importers.v1.utils import import_dataset
+from superset.datasets.schemas import ImportV1DatasetSchema
+from superset.models.dashboard import dashboard_slices
+from superset.queries.saved_queries.commands.importers.v1.utils import (
+ import_saved_query,
+)
+from superset.queries.saved_queries.schemas import ImportV1SavedQuerySchema
+
+
+class ImportAssetsCommand(BaseCommand):
+ """
+ Command for importing databases, datasets, charts, dashboards and saved queries.
+
+ This command is used for managing Superset assets externally under source control,
+ and will overwrite everything.
+ """
+
+ schemas: Dict[str, Schema] = {
+ "charts/": ImportV1ChartSchema(),
+ "dashboards/": ImportV1DashboardSchema(),
+ "datasets/": ImportV1DatasetSchema(),
+ "databases/": ImportV1DatabaseSchema(),
+ "queries/": ImportV1SavedQuerySchema(),
+ }
+
+ # pylint: disable=unused-argument
+ def __init__(self, contents: Dict[str, str], *args: Any, **kwargs: Any):
+ self.contents = contents
+ self.passwords: Dict[str, str] = kwargs.get("passwords") or {}
Review comment:
Thanks for the suggestion! There's a subtle difference here that I want to capture; if `passwords` is passed as a keyword argument and is falsy (most likely `None`) we want it to be a dict, which is why I did the pattern with `or` instead of `.get`.
--
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