mistercrunch closed pull request #5183: fetch datasources from broker endpoint 
when refresh new datasources
URL: https://github.com/apache/incubator-superset/pull/5183

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/connectors/druid/models.py 
index d958730db1..fd66bd6159 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -121,10 +121,10 @@ def get_base_url(host, port):
         url = '{0}:{1}'.format(host, port) if port else host
         return url
-    def get_base_coordinator_url(self):
+    def get_base_broker_url(self):
         base_url = self.get_base_url(
-            self.coordinator_host, self.coordinator_port)
-        return '{base_url}/{self.coordinator_endpoint}'.format(**locals())
+            self.broker_host, self.broker_port)
+        return '{base_url}/{self.broker_endpoint}'.format(**locals())
     def get_pydruid_client(self):
         cli = PyDruid(
@@ -133,7 +133,7 @@ def get_pydruid_client(self):
         return cli
     def get_datasources(self):
-        endpoint = self.get_base_coordinator_url() + '/datasources'
+        endpoint = self.get_base_broker_url() + '/datasources'
         return json.loads(requests.get(endpoint).text)
     def get_druid_version(self):
diff --git a/tests/druid_tests.py b/tests/druid_tests.py
index e50e1dbac5..bb932f3176 100644
--- a/tests/druid_tests.py
+++ b/tests/druid_tests.py
@@ -94,6 +94,7 @@ def get_test_cluster_obj(self):
+            broker_endpoint='druid/v2',
     def get_cluster(self, PyDruid):
@@ -456,8 +457,8 @@ def test_urls(self):
-            cluster.get_base_coordinator_url(),
-            'http://localhost:7979/druid/coordinator/v1/metadata')
+            cluster.get_base_broker_url(),
+            'http://localhost:7980/druid/v2')
 if __name__ == '__main__':


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

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

Reply via email to