hughhhh commented on code in PR #24964:
URL: https://github.com/apache/superset/pull/24964#discussion_r1320547947


##########
tests/integration_tests/tags/api_tests.py:
##########
@@ -501,3 +503,54 @@ def test_put_tag(self):
             .one_or_none()
         )
         assert tag is not None
+
+    @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
+    @pytest.mark.usefixtures("create_tags")
+    def test_failed_put_tag(self):
+        self.login(username="admin")
+
+        tag_to_update = db.session.query(Tag).first()
+        uri = f"api/v1/tag/{tag_to_update.id}"
+        rv = self.client.put(uri, json={"foo": "bar"})
+
+        self.assertEqual(rv.status_code, 400)
+
+    @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
+    def test_post_bulk_tag(self):
+        self.login(username="admin")
+        uri = "api/v1/tag/bulk_create"
+        dashboard = (
+            db.session.query(Dashboard)
+            .filter(Dashboard.dashboard_title == "World Bank's Data")
+            .first()
+        )
+        chart = db.session.query(Slice).first()
+        tags = ["tag1", "tag2", "tag3"]
+        rv = self.client.post(
+            uri,
+            json={
+                "tags": ["tag1", "tag2", "tag3"],
+                "objects_to_tag": [["dashboard", dashboard.id], ["chart", 
chart.id]],

Review Comment:
   So if you look at the API portion we are basically just taking the `tags` 
and running the create command over it this array which basically want you are 
suggesting but in the frontend. I think this nit, but if you feel passionate 
about making sure we send a flat structure we can have further discussions.
   
   I personally rather our client be super light and send the information to 
the backend to process accordingly 



##########
Makefile:
##########
@@ -115,3 +115,31 @@ report-celery-beat:
 
 admin-user:
        superset fab create-admin
+
+# Create a postgres instance using docker
+# CLI: $ psql postgresql://postgres:1234@localhost:5432/postgres
+# superset_config.py: SQLALCHEMY_DATABASE_URI = 
'postgresql://postgres:1234@localhost:5432/postgres'
+db:
+       # start postgres with detached mode
+       docker run -d -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD="1234" --name 
pg postgres:alpine;\
+       EXIT_CODE=$$?;\
+       echo $$EXIT_CODE;\
+       echo "command exited with $$EXIT_CODE";\
+       if [ $$EXIT_CODE -ne "0" ]; then docker start pg; echo "DB has been 
created"; fi
+
+db-stop:
+       docker stop pg
+
+cache:
+       docker run -d --name redis-stack-server -p 6379:6379 
redis/redis-stack-server:latest;\
+       EXIT_CODE=$$?;\
+       echo $$EXIT_CODE;\
+       echo "command exited with $$EXIT_CODE";\
+       if [ $$EXIT_CODE -ne "0" ]; then docker start redis-stack-server; echo 
"cache has been created"; fi

Review Comment:
   oops forget to remove this



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to