Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make port number optional in superset for druid #5020

Merged
merged 2 commits into from May 16, 2018

Conversation

amalakar
Copy link
Contributor

It appears that urllib throws error with ssl if port number is provided

    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

The above call fails with the following error:

urllib2.HTTPError: HTTP Error 404: Not Found

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.
@amalakar
Copy link
Contributor Author

Full stack trace:

Traceback (most recent call last):
  File "/Users/amalakar/Library/Preferences/IntelliJIdea2017.3/scratches/scratch_6.py", line 21, in <module>
    res = urllib.request.urlopen(req)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

@@ -116,7 +116,12 @@ def data(self):
def get_base_url(host, port):
if not re.match('http(s)?://', host):
host = 'http://' + host
return '{0}:{1}'.format(host, port)

if port:
Copy link
Member

@hughhhh hughhhh May 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

url = '{0}:{1}'.format(host, port) if port else host
return url

@codecov-io
Copy link

codecov-io commented May 16, 2018

Codecov Report

Merging #5020 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5020      +/-   ##
==========================================
+ Coverage   77.34%   77.34%   +<.01%     
==========================================
  Files          44       44              
  Lines        8664     8665       +1     
==========================================
+ Hits         6701     6702       +1     
  Misses       1963     1963
Impacted Files Coverage Δ
superset/connectors/druid/models.py 80.51% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e72c9cd...d3f2a12. Read the comment docs.

@hughhhh hughhhh merged commit 2bf53da into apache:master May 16, 2018
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request May 16, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request May 30, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request May 30, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jun 4, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jun 7, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jun 7, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jun 7, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jun 7, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jun 27, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way

(cherry picked from commit 2bf53da)
@amalakar amalakar deleted the druid_optional_port branch July 19, 2018 21:44
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Make port number optional in superset for druid

It appears that urllib throws error with ssl if port number is provided

```
    url = "https://example.com:443/druid/v2"

    req = urllib.request.Request(url, druid_query_str, headers)
    res = urllib.request.urlopen(req)

```

The above call fails with the following error:
```
urllib2.HTTPError: HTTP Error 404: Not Found
```

If url is set to https://example.com/druid/v2 it works, this change
makes the port number optional.

* Rewrite if/else in concisely python way
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants