Git Product home page Git Product logo

pymldb's Introduction

pymldb's People

Contributors

atremblay avatar jeremybarnes avatar jraby avatar mailletf avatar nicolaskruchten avatar simlmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymldb's Issues

Problem with python 3.5

Trying to port the demo notebook to python 3.5 (Anaconda on Apple Mac)

from pymldb import Connection
mldb = Connection()
from urllib.request import urlopen  # changed original urllib2 to this
import pandas as pd, numpy as np, matplotlib.pyplot as plt
from matplotlib.offsetbox import TextArea, DrawingArea, OffsetImage, AnnotationBbox
from matplotlib._png import read_png
%matplotlib inline
prefix = "http://public.mldb.ai/datasets/dataset-builder"

print( mldb.put("/v1/procedures/embedded_images", {        # added parenthesis
    "type": "import.text",
    "params": {
        "dataFileUrl": prefix + "/cache/dataset_creator_embedding_realestate.csv.gz",
        "outputDataset": {
                "id": "embedded_images_realestate",
                "type": "embedding"
            },
        "select": "* EXCLUDING(rowName)",
        "named": "rowName",
        "runOnCreation": True
    }
}) 
     )

This is the error I get:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    384             try:  # Python 2.7, use buffering of HTTP responses
--> 385                 httplib_response = conn.getresponse(buffering=True)
    386             except TypeError:  # Python 2.6 and older

TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

RemoteDisconnected                        Traceback (most recent call last)
/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
    577                                                   body=body, headers=headers,
--> 578                                                   chunked=chunked)
    579 

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    386             except TypeError:  # Python 2.6 and older
--> 387                 httplib_response = conn.getresponse()
    388         except (SocketTimeout, BaseSSLError, SocketError) as e:

/Users/e/anaconda3/lib/python3.5/http/client.py in getresponse(self)
   1196             try:
-> 1197                 response.begin()
   1198             except ConnectionError:

/Users/e/anaconda3/lib/python3.5/http/client.py in begin(self)
    296         while True:
--> 297             version, status, reason = self._read_status()
    298             if status != CONTINUE:

/Users/e/anaconda3/lib/python3.5/http/client.py in _read_status(self)
    265             # sending a valid response.
--> 266             raise RemoteDisconnected("Remote end closed connection without"
    267                                      " response")

RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

ProtocolError                             Traceback (most recent call last)
/Users/e/anaconda3/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    402                     retries=self.max_retries,
--> 403                     timeout=timeout
    404                 )

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
    622             retries = retries.increment(method, url, error=e, _pool=self,
--> 623                                         _stacktrace=sys.exc_info()[2])
    624             retries.sleep()

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    254             if read is False:
--> 255                 raise six.reraise(type(error), error, _stacktrace)
    256             elif read is not None:

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
    308         if value.__traceback__ is not tb:
--> 309             raise value.with_traceback(tb)
    310         raise value

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
    577                                                   body=body, headers=headers,
--> 578                                                   chunked=chunked)
    579 

/Users/e/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    386             except TypeError:  # Python 2.6 and older
--> 387                 httplib_response = conn.getresponse()
    388         except (SocketTimeout, BaseSSLError, SocketError) as e:

/Users/e/anaconda3/lib/python3.5/http/client.py in getresponse(self)
   1196             try:
-> 1197                 response.begin()
   1198             except ConnectionError:

/Users/e/anaconda3/lib/python3.5/http/client.py in begin(self)
    296         while True:
--> 297             version, status, reason = self._read_status()
    298             if status != CONTINUE:

/Users/e/anaconda3/lib/python3.5/http/client.py in _read_status(self)
    265             # sending a valid response.
--> 266             raise RemoteDisconnected("Remote end closed connection without"
    267                                      " response")

ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-9-841a388121c0> in <module>()
     11         "select": "* EXCLUDING(rowName)",
     12         "named": "rowName",
---> 13         "runOnCreation": True
     14     }
     15 }) 

/Users/e/anaconda3/lib/python3.5/site-packages/pymldb/__init__.py in inner(*args, **kwargs)
     19 def decorate_response(fn):
     20     def inner(*args, **kwargs):
---> 21         result = add_repr_html_to_response(fn(*args, **kwargs))
     22         if result.status_code < 200 or result.status_code >= 400:
     23             raise ResourceError(result)

/Users/e/anaconda3/lib/python3.5/site-packages/pymldb/__init__.py in put(self, url, payload)
     62         if payload is None:
     63             payload = {}
---> 64         return requests.put(self.uri + url, json=payload)
     65 
     66     @decorate_response

/Users/e/anaconda3/lib/python3.5/site-packages/requests/api.py in put(url, data, **kwargs)
    122     """
    123 
--> 124     return request('put', url, data=data, **kwargs)
    125 
    126 

/Users/e/anaconda3/lib/python3.5/site-packages/requests/api.py in request(method, url, **kwargs)
     55     # cases, and look like a memory leak in others.
     56     with sessions.Session() as session:
---> 57         return session.request(method=method, url=url, **kwargs)
     58 
     59 

/Users/e/anaconda3/lib/python3.5/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    473         }
    474         send_kwargs.update(settings)
--> 475         resp = self.send(prep, **send_kwargs)
    476 
    477         return resp

/Users/e/anaconda3/lib/python3.5/site-packages/requests/sessions.py in send(self, request, **kwargs)
    583 
    584         # Send the request
--> 585         r = adapter.send(request, **kwargs)
    586 
    587         # Total elapsed time of the request (approximately)

/Users/e/anaconda3/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    451 
    452         except (ProtocolError, socket.error) as err:
--> 453             raise ConnectionError(err, request=request)
    454 
    455         except MaxRetryError as e:

ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

Please note that I can download the data from the browser at http://public.mldb.ai/datasets/dataset-builder/cache/dataset_creator_embedding_realestate.csv.gz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.