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

load_demo raises urllib.error.HTTPError: HTTP Error 403: Forbidden #284

Closed
amontanez24 opened this issue Apr 26, 2023 · 0 comments · Fixed by #287
Closed

load_demo raises urllib.error.HTTPError: HTTP Error 403: Forbidden #284

amontanez24 opened this issue Apr 26, 2023 · 0 comments · Fixed by #287
Labels
bug Something isn't working
Milestone

Comments

@amontanez24
Copy link
Contributor

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • CTGAN version: 0.7.1
  • Python version: Any
  • Operating System: Any

Error Description

The load_demo function is currently broken because it points to an old S3 bucket. To fix this we should migrate the demo dataset currently at 'http://ctgan-data.s3.amazonaws.com/census.csv.gz' to the new S3 bucket and load from there instead.

Steps to reproduce

from ctgan import CTGAN
from ctgan import load_demo

real_data = load_demo()
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/ctgan/demo.py", line 10, in load_demo
    return pd.read_csv(DEMO_URL, compression='gzip')
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/readers.py", line 586, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/readers.py", line 482, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/readers.py", line 811, in __init__
    self._engine = self._make_engine(self.engine)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/readers.py", line 10[40](https://github.com/sdv-dev/CTGAN/actions/runs/4811434298/jobs/8565426948#step:5:41), in _make_engine
    return mapping[engine](self.f, **self.options)  # type: ignore[call-arg]
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 51, in __init__
    self._open_handles(src, kwds)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/parsers/base_parser.py", line 229, in _open_handles
    errors=kwds.get("encoding_errors", "strict"),
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/common.py", line 614, in get_handle
    storage_options=storage_options,
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/common.py", line 312, in _get_filepath_or_buffer
    with urlopen(req_info) as req:
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/site-packages/pandas/io/common.py", line 212, in urlopen
    return urllib.request.urlopen(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 6[41](https://github.com/sdv-dev/CTGAN/actions/runs/4811434298/jobs/8565426948#step:5:42), in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/opt/hostedtoolcache/Python/3.7.16/x64/lib/python3.7/urllib/request.py", line 6[49](https://github.com/sdv-dev/CTGAN/actions/runs/4811434298/jobs/8565426948#step:5:50), in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
@amontanez24 amontanez24 added the bug Something isn't working label Apr 26, 2023
@amontanez24 amontanez24 added this to the 0.7.2 milestone May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant