{ "cells": [ { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", "import sys\n", "sys.path.append(\"..\")\n", "from optimus import Optimus\n", "\n", "# Create optimus\n", "_load = Optimus(\"ibis\", verbose = True)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "impala://cloudera:cloudera@35.223.122.210:10000/default\n" ] } ], "source": [ "# Put your db credentials here\n", "db = _load.connect(\n", " driver=\"impala\",\n", " host=\"35.223.122.210\", \n", " database= \"default\", \n", " user= \"cloudera\", \n", " password = \"cloudera\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = db.table_to_df(\"prueba\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "_processing = Optimus(\"pandas\", verbose = True)\n", "df = _processing.from_dataframe(df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting pure-sasl\n", " Downloading pure-sasl-0.6.2.tar.gz (11 kB)\n", "Building wheels for collected packages: pure-sasl\n", " Building wheel for pure-sasl (setup.py): started\n", " Building wheel for pure-sasl (setup.py): finished with status 'done'\n", " Created wheel for pure-sasl: filename=pure_sasl-0.6.2-py3-none-any.whl size=11435 sha256=5aa6d172a618efdeb1b9a62e705812572f668681aed405d6f40a258c76176ab5\n", " Stored in directory: c:\\users\\argenisleon\\appdata\\local\\pip\\cache\\wheels\\60\\6d\\c4\\eeb9f5eae120dce84399f49fc92b447f5b9c2788217aee3209\n", "Successfully built pure-sasl\n", "Installing collected packages: pure-sasl\n", "Successfully installed pure-sasl-0.6.2\n" ] } ], "source": [ "# https://github.com/cloudera/impyla/issues/315\n", "# pip uninstall pure-sasl\n", "#pip uninstall sasl\n", "!pip install pure-sasl" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Without an HDFS connection, certain functionality may be disabled\n" ] } ], "source": [ "import ibis\n", "\n", "hdfs = ibis.impala.hdfs_connect(host='localhost')\n", "con = ibis.impala.connect(user=\"cloudera\", password=\"cloudera\", \n", " host='35.223.122.210', port= 21050, database='default'\n", ")" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['prueba']" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "con.list_tables()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "table = con.table('prueba', database='default')" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'SELECT *\\nFROM default.`prueba`'" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table.compile()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['__bool__',\n", " '__call__',\n", " '__class__',\n", " '__contains__',\n", " '__delattr__',\n", " '__dict__',\n", " '__dir__',\n", " '__doc__',\n", " '__eq__',\n", " '__format__',\n", " '__ge__',\n", " '__getattr__',\n", " '__getattribute__',\n", " '__getitem__',\n", " '__gt__',\n", " '__hash__',\n", " '__init__',\n", " '__init_subclass__',\n", " '__le__',\n", " '__len__',\n", " '__lt__',\n", " '__module__',\n", " '__ne__',\n", " '__new__',\n", " '__nonzero__',\n", " '__reduce__',\n", " '__reduce_ex__',\n", " '__repr__',\n", " '__setattr__',\n", " '__setstate__',\n", " '__sizeof__',\n", " '__str__',\n", " '__subclasshook__',\n", " '__weakref__',\n", " '_alter_table_helper',\n", " '_assert_valid',\n", " '_client',\n", " '_database',\n", " '_ensure_expr',\n", " '_execute',\n", " '_factory',\n", " '_get_type',\n", " '_is_materialized',\n", " '_is_valid',\n", " '_key',\n", " '_match_name',\n", " '_qualified_name',\n", " '_repr',\n", " '_repr_png_',\n", " '_resolve',\n", " '_root_tables',\n", " '_safe_name',\n", " '_type_display',\n", " '_unqualified_name',\n", " 'add_partition',\n", " 'aggregate',\n", " 'alter',\n", " 'alter_partition',\n", " 'anti_join',\n", " 'any_inner_join',\n", " 'any_left_join',\n", " 'asof_join',\n", " 'column_stats',\n", " 'columns',\n", " 'compile',\n", " 'compute_stats',\n", " 'count',\n", " 'cross_join',\n", " 'describe_formatted',\n", " 'difference',\n", " 'distinct',\n", " 'drop',\n", " 'drop_partition',\n", " 'equals',\n", " 'execute',\n", " 'files',\n", " 'filter',\n", " 'get_column',\n", " 'get_columns',\n", " 'group_by',\n", " 'groupby',\n", " 'head',\n", " 'info',\n", " 'inner_join',\n", " 'insert',\n", " 'intersect',\n", " 'invalidate_metadata',\n", " 'is_partitioned',\n", " 'join',\n", " 'left_join',\n", " 'limit',\n", " 'load_data',\n", " 'materialize',\n", " 'metadata',\n", " 'mutate',\n", " 'name',\n", " 'op',\n", " 'outer_join',\n", " 'partition_schema',\n", " 'partitions',\n", " 'pipe',\n", " 'projection',\n", " 'prueba1',\n", " 'refresh',\n", " 'relabel',\n", " 'rename',\n", " 'rowid',\n", " 'schema',\n", " 'select',\n", " 'semi_join',\n", " 'set_column',\n", " 'set_external',\n", " 'sort_by',\n", " 'stats',\n", " 'to_array',\n", " 'truncate',\n", " 'union',\n", " 'verify',\n", " 'view',\n", " 'visualize']" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dir(table)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
prueba1
0prueba
\n", "
" ], "text/plain": [ " prueba1\n", "0 prueba" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table.execute()\n", "# dir(table)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "ename": "AttributeError", "evalue": "'ImpalaClient' object has no attribute 'tables'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mcon\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mAttributeError\u001b[0m: 'ImpalaClient' object has no attribute 'tables'" ] } ], "source": [ "con.tables()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['HDFS', 'ImpalaClient', 'ImpalaConnection', 'ImpalaDatabase', 'ImpalaTable', 'WebHDFS', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'add_operation', 'aggregate_function', 'client', 'com', 'compat', 'compile', 'compiler', 'connect', 'ddl', 'dialect', 'hdfs_connect', 'options', 'scalar_function', 'udf', 'verify', 'wrap_uda', 'wrap_udf']\n" ] }, { "ename": "TypeError", "evalue": "connect() got an unexpected keyword argument 'url'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtables\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;32m~\\Documents\\Optimus\\optimus\\engines\\ibis\\io\\jdbc.py\u001b[0m in \u001b[0;36mtables\u001b[1;34m(self, schema, database, limit)\u001b[0m\n\u001b[0;32m 53\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mtables\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdatabase\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 54\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdir\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mibis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimpala\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 55\u001b[1;33m \u001b[0mcon\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mibis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimpala\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0murl\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0muri\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 56\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mcon\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlist_tables\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 57\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mTypeError\u001b[0m: connect() got an unexpected keyword argument 'url'" ] } ], "source": [ "db.tables()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "ename": "StatementError", "evalue": "(thriftpy2.protocol.exc.TProtocolException) No protocol version header\n[SQL: SELECT * FROM prueba LIMIT 0]", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTProtocolException\u001b[0m Traceback (most recent call last)", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36m_execute_context\u001b[1;34m(self, dialect, constructor, statement, parameters, *args)\u001b[0m\n\u001b[0;32m 1178\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1179\u001b[1;33m \u001b[0mcontext\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconstructor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdialect\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconn\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1180\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\default.py\u001b[0m in \u001b[0;36m_init_statement\u001b[1;34m(cls, dialect, connection, dbapi_connection, statement, parameters)\u001b[0m\n\u001b[0;32m 908\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 909\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcreate_cursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 910\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\sqlalchemy.py\u001b[0m in \u001b[0;36mcreate_cursor\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 136\u001b[0m \u001b[0mcursor_configuration\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecution_options\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'cursor_configuration'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 137\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_dbapi_connection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mconfiguration\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcursor_configuration\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 138\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\pool\\base.py\u001b[0m in \u001b[0;36mcursor\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 964\u001b[0m \"\"\"\n\u001b[1;32m--> 965\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconnection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 966\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36mcursor\u001b[1;34m(self, user, configuration, convert_types, dictify, fetch_error)\u001b[0m\n\u001b[0;32m 123\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 124\u001b[1;33m \u001b[0msession\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mservice\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen_session\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0muser\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconfiguration\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 125\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36mopen_session\u001b[1;34m(self, user, configuration)\u001b[0m\n\u001b[0;32m 1074\u001b[0m configuration=configuration)\n\u001b[1;32m-> 1075\u001b[1;33m \u001b[0mresp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_rpc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'OpenSession'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1076\u001b[0m return HS2Session(self, resp.sessionHandle,\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36m_rpc\u001b[1;34m(self, func_name, request)\u001b[0m\n\u001b[0;32m 992\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_log_request\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 993\u001b[1;33m \u001b[0mresponse\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_execute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 994\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_log_response\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36m_execute\u001b[1;34m(self, func_name, request)\u001b[0m\n\u001b[0;32m 1009\u001b[0m \u001b[0mfunc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfunc_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1010\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1011\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0msocket\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\thrift.py\u001b[0m in \u001b[0;36m_req\u001b[1;34m(self, _api, *args, **kwargs)\u001b[0m\n\u001b[0;32m 218\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresult_cls\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"oneway\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 219\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_recv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_api\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 220\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\thrift.py\u001b[0m in \u001b[0;36m_recv\u001b[1;34m(self, _api)\u001b[0m\n\u001b[0;32m 230\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_recv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_api\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 231\u001b[1;33m \u001b[0mfname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmtype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrseqid\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_iprot\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_message_begin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 232\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mmtype\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0mTMessageType\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mEXCEPTION\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\protocol\\binary.py\u001b[0m in \u001b[0;36mread_message_begin\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 372\u001b[0m api, ttype, seqid = read_message_begin(\n\u001b[1;32m--> 373\u001b[1;33m self.trans, strict=self.strict_read)\n\u001b[0m\u001b[0;32m 374\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mapi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mttype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mseqid\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\protocol\\binary.py\u001b[0m in \u001b[0;36mread_message_begin\u001b[1;34m(inbuf, strict)\u001b[0m\n\u001b[0;32m 178\u001b[0m raise TProtocolException(type=TProtocolException.BAD_VERSION,\n\u001b[1;32m--> 179\u001b[1;33m message='No protocol version header')\n\u001b[0m\u001b[0;32m 180\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mTProtocolException\u001b[0m: No protocol version header", "\nThe above exception was the direct cause of the following exception:\n", "\u001b[1;31mStatementError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtable_to_df\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"prueba\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mext\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdisplay\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;32m~\\Documents\\Optimus\\optimus\\engines\\ibis\\io\\jdbc.py\u001b[0m in \u001b[0;36mtable_to_df\u001b[1;34m(self, table_name, columns, limit)\u001b[0m\n\u001b[0;32m 59\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlimit\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 60\u001b[0m \u001b[0mlimit\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mLIMIT_TABLE\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 61\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mIbisDataFrame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtable_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\ibis\\backends\\mysql\\client.py\u001b[0m in \u001b[0;36mtable\u001b[1;34m(self, name, database, schema)\u001b[0m\n\u001b[0;32m 202\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mschema\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 203\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 204\u001b[1;33m \u001b[0malch_table\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get_sqla_table\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mschema\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 205\u001b[0m \u001b[0mnode\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtable_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0malch_table\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_schemas\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 206\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtable_expr_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnode\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\ibis\\backends\\base_sqlalchemy\\alchemy.py\u001b[0m in \u001b[0;36m_get_sqla_table\u001b[1;34m(self, name, schema, autoload)\u001b[0m\n\u001b[0;32m 1298\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1299\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_get_sqla_table\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mautoload\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1300\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0msa\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mTable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmeta\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mschema\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mautoload\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mautoload\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1301\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1302\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_sqla_table_to_expr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtable\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m\u001b[0m in \u001b[0;36m__new__\u001b[1;34m(cls, *args, **kw)\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\util\\deprecations.py\u001b[0m in \u001b[0;36mwarned\u001b[1;34m(fn, *args, **kwargs)\u001b[0m\n\u001b[0;32m 126\u001b[0m )\n\u001b[0;32m 127\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 128\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 129\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 130\u001b[0m \u001b[0mdoc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__doc__\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mfn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__doc__\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;34m\"\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\sql\\schema.py\u001b[0m in \u001b[0;36m__new__\u001b[1;34m(cls, *args, **kw)\u001b[0m\n\u001b[0;32m 494\u001b[0m \u001b[1;32mexcept\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 495\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msafe_reraise\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 496\u001b[1;33m \u001b[0mmetadata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_remove_table\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 497\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 498\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\util\\langhelpers.py\u001b[0m in \u001b[0;36m__exit__\u001b[1;34m(self, type_, value, traceback)\u001b[0m\n\u001b[0;32m 66\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_exc_info\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mNone\u001b[0m \u001b[1;31m# remove potential circular references\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 67\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwarn_only\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 68\u001b[1;33m \u001b[0mcompat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreraise\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexc_type\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_value\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_tb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 69\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 70\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mcompat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpy3k\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_exc_info\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_exc_info\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\util\\compat.py\u001b[0m in \u001b[0;36mreraise\u001b[1;34m(tp, value, tb, cause)\u001b[0m\n\u001b[0;32m 151\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__traceback__\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mtb\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 152\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwith_traceback\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 153\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 154\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 155\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mu\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\sql\\schema.py\u001b[0m in \u001b[0;36m__new__\u001b[1;34m(cls, *args, **kw)\u001b[0m\n\u001b[0;32m 489\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_add_table\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtable\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 490\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 491\u001b[1;33m \u001b[0mtable\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_init\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 492\u001b[0m \u001b[0mtable\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdispatch\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mafter_parent_attach\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtable\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 493\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mtable\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\sql\\schema.py\u001b[0m in \u001b[0;36m_init\u001b[1;34m(self, name, metadata, *args, **kwargs)\u001b[0m\n\u001b[0;32m 583\u001b[0m \u001b[0minclude_columns\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 584\u001b[0m \u001b[0m_extend_on\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0m_extend_on\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 585\u001b[1;33m \u001b[0mresolve_fks\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mresolve_fks\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 586\u001b[0m )\n\u001b[0;32m 587\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\sql\\schema.py\u001b[0m in \u001b[0;36m_autoload\u001b[1;34m(self, metadata, autoload_with, include_columns, exclude_columns, resolve_fks, _extend_on)\u001b[0m\n\u001b[0;32m 624\u001b[0m \u001b[0mexclude_columns\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 625\u001b[0m \u001b[0mresolve_fks\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 626\u001b[1;33m \u001b[0m_extend_on\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0m_extend_on\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 627\u001b[0m )\n\u001b[0;32m 628\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36mrun_callable\u001b[1;34m(self, callable_, *args, **kwargs)\u001b[0m\n\u001b[0;32m 2148\u001b[0m \"\"\"\n\u001b[0;32m 2149\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_contextual_connect\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mconn\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2150\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mconn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun_callable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcallable_\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2151\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2152\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstatement\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0mmultiparams\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36mrun_callable\u001b[1;34m(self, callable_, *args, **kwargs)\u001b[0m\n\u001b[0;32m 1602\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1603\u001b[0m \"\"\"\n\u001b[1;32m-> 1604\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mcallable_\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1605\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1606\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_run_visitor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvisitorcallable\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0melement\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\default.py\u001b[0m in \u001b[0;36mreflecttable\u001b[1;34m(self, connection, table, include_columns, exclude_columns, resolve_fks, **opts)\u001b[0m\n\u001b[0;32m 429\u001b[0m \u001b[0minsp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mreflection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mInspector\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfrom_engine\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mconnection\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 430\u001b[0m return insp.reflecttable(\n\u001b[1;32m--> 431\u001b[1;33m \u001b[0mtable\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minclude_columns\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexclude_columns\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresolve_fks\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 432\u001b[0m )\n\u001b[0;32m 433\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\reflection.py\u001b[0m in \u001b[0;36mreflecttable\u001b[1;34m(self, table, include_columns, exclude_columns, resolve_fks, _extend_on)\u001b[0m\n\u001b[0;32m 638\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 639\u001b[0m for col_d in self.get_columns(\n\u001b[1;32m--> 640\u001b[1;33m \u001b[0mtable_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mtable\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdialect_kwargs\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 641\u001b[0m ):\n\u001b[0;32m 642\u001b[0m \u001b[0mfound_table\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\reflection.py\u001b[0m in \u001b[0;36mget_columns\u001b[1;34m(self, table_name, schema, **kw)\u001b[0m\n\u001b[0;32m 371\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 372\u001b[0m col_defs = self.dialect.get_columns(\n\u001b[1;32m--> 373\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbind\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtable_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minfo_cache\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minfo_cache\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 374\u001b[0m )\n\u001b[0;32m 375\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mcol_def\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mcol_defs\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\sqlalchemy.py\u001b[0m in \u001b[0;36mget_columns\u001b[1;34m(self, connection, table_name, schema, **kwargs)\u001b[0m\n\u001b[0;32m 204\u001b[0m \u001b[0mname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'%s.%s'\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 205\u001b[0m \u001b[0mquery\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'SELECT * FROM %s LIMIT 0'\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 206\u001b[1;33m \u001b[0mcursor\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconnection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mquery\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 207\u001b[0m \u001b[0mschema\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcursor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdescription\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 208\u001b[0m \u001b[1;31m# We need to fetch the empty results otherwise these queries remain in\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36mexecute\u001b[1;34m(self, object_, *multiparams, **params)\u001b[0m\n\u001b[0;32m 980\u001b[0m \"\"\"\n\u001b[0;32m 981\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobject_\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstring_types\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 982\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_execute_text\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobject_\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmultiparams\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 983\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 984\u001b[0m \u001b[0mmeth\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mobject_\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_execute_on_connection\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36m_execute_text\u001b[1;34m(self, statement, multiparams, params)\u001b[0m\n\u001b[0;32m 1153\u001b[0m \u001b[0mparameters\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1154\u001b[0m \u001b[0mstatement\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1155\u001b[1;33m \u001b[0mparameters\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1156\u001b[0m )\n\u001b[0;32m 1157\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_has_events\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mengine\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_has_events\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36m_execute_context\u001b[1;34m(self, dialect, constructor, statement, parameters, *args)\u001b[0m\n\u001b[0;32m 1180\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1181\u001b[0m self._handle_dbapi_exception(\n\u001b[1;32m-> 1182\u001b[1;33m \u001b[0me\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext_type\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstatement\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparameters\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1183\u001b[0m )\n\u001b[0;32m 1184\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36m_handle_dbapi_exception\u001b[1;34m(self, e, statement, parameters, cursor, context)\u001b[0m\n\u001b[0;32m 1464\u001b[0m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mraise_from_cause\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnewraise\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1465\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mshould_wrap\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1466\u001b[1;33m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mraise_from_cause\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msqlalchemy_exception\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1467\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1468\u001b[0m \u001b[0mutil\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreraise\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mexc_info\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\util\\compat.py\u001b[0m in \u001b[0;36mraise_from_cause\u001b[1;34m(exception, exc_info)\u001b[0m\n\u001b[0;32m 396\u001b[0m \u001b[0mexc_type\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_value\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_tb\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 397\u001b[0m \u001b[0mcause\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mexc_value\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mexc_value\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mexception\u001b[0m \u001b[1;32melse\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 398\u001b[1;33m \u001b[0mreraise\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexception\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexception\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtb\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mexc_tb\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcause\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcause\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 399\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 400\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\util\\compat.py\u001b[0m in \u001b[0;36mreraise\u001b[1;34m(tp, value, tb, cause)\u001b[0m\n\u001b[0;32m 150\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__cause__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcause\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 151\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__traceback__\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mtb\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 152\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwith_traceback\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 153\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 154\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\base.py\u001b[0m in \u001b[0;36m_execute_context\u001b[1;34m(self, dialect, constructor, statement, parameters, *args)\u001b[0m\n\u001b[0;32m 1177\u001b[0m \u001b[0mconn\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_revalidate_connection\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1178\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1179\u001b[1;33m \u001b[0mcontext\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconstructor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdialect\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconn\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1180\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1181\u001b[0m self._handle_dbapi_exception(\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\engine\\default.py\u001b[0m in \u001b[0;36m_init_statement\u001b[1;34m(cls, dialect, connection, dbapi_connection, statement, parameters)\u001b[0m\n\u001b[0;32m 907\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstatement\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0municode_statement\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mstatement\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 908\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 909\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcreate_cursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 910\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 911\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\sqlalchemy.py\u001b[0m in \u001b[0;36mcreate_cursor\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 135\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_is_server_side\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 136\u001b[0m \u001b[0mcursor_configuration\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecution_options\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'cursor_configuration'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 137\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_dbapi_connection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mconfiguration\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcursor_configuration\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 138\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 139\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\sqlalchemy\\pool\\base.py\u001b[0m in \u001b[0;36mcursor\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 963\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 964\u001b[0m \"\"\"\n\u001b[1;32m--> 965\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconnection\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 966\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 967\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m__getattr__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36mcursor\u001b[1;34m(self, user, configuration, convert_types, dictify, fetch_error)\u001b[0m\n\u001b[0;32m 122\u001b[0m \u001b[0mlog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'.cursor(): getting new session_handle'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 123\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 124\u001b[1;33m \u001b[0msession\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mservice\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen_session\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0muser\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconfiguration\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 125\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 126\u001b[0m log.debug('HiveServer2Cursor(service=%s, session_handle=%s, '\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36mopen_session\u001b[1;34m(self, user, configuration)\u001b[0m\n\u001b[0;32m 1073\u001b[0m \u001b[0musername\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0muser\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1074\u001b[0m configuration=configuration)\n\u001b[1;32m-> 1075\u001b[1;33m \u001b[0mresp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_rpc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'OpenSession'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1076\u001b[0m return HS2Session(self, resp.sessionHandle,\n\u001b[0;32m 1077\u001b[0m \u001b[0mresp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconfiguration\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36m_rpc\u001b[1;34m(self, func_name, request)\u001b[0m\n\u001b[0;32m 991\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_rpc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 992\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_log_request\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 993\u001b[1;33m \u001b[0mresponse\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_execute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 994\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_log_response\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 995\u001b[0m \u001b[0merr_if_rpc_not_ok\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\impala\\hiveserver2.py\u001b[0m in \u001b[0;36m_execute\u001b[1;34m(self, func_name, request)\u001b[0m\n\u001b[0;32m 1008\u001b[0m \u001b[0mlog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'Transport opened'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1009\u001b[0m \u001b[0mfunc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfunc_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1010\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrequest\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1011\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0msocket\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1012\u001b[0m log.exception('Failed to open transport (tries_left=%s)',\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\thrift.py\u001b[0m in \u001b[0;36m_req\u001b[1;34m(self, _api, *args, **kwargs)\u001b[0m\n\u001b[0;32m 217\u001b[0m \u001b[1;31m# wait result only if non-oneway\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 218\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresult_cls\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"oneway\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 219\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_recv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_api\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 220\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 221\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_send\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_api\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\thrift.py\u001b[0m in \u001b[0;36m_recv\u001b[1;34m(self, _api)\u001b[0m\n\u001b[0;32m 229\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 230\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_recv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_api\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 231\u001b[1;33m \u001b[0mfname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmtype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrseqid\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_iprot\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_message_begin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 232\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mmtype\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0mTMessageType\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mEXCEPTION\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 233\u001b[0m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mTApplicationException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\protocol\\binary.py\u001b[0m in \u001b[0;36mread_message_begin\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 371\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mread_message_begin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 372\u001b[0m api, ttype, seqid = read_message_begin(\n\u001b[1;32m--> 373\u001b[1;33m self.trans, strict=self.strict_read)\n\u001b[0m\u001b[0;32m 374\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mapi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mttype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mseqid\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 375\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\thriftpy2\\protocol\\binary.py\u001b[0m in \u001b[0;36mread_message_begin\u001b[1;34m(inbuf, strict)\u001b[0m\n\u001b[0;32m 177\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mstrict\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 178\u001b[0m raise TProtocolException(type=TProtocolException.BAD_VERSION,\n\u001b[1;32m--> 179\u001b[1;33m message='No protocol version header')\n\u001b[0m\u001b[0;32m 180\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 181\u001b[0m \u001b[0mname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0minbuf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msz\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'utf-8'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mStatementError\u001b[0m: (thriftpy2.protocol.exc.TProtocolException) No protocol version header\n[SQL: SELECT * FROM prueba LIMIT 0]" ] } ], "source": [ "db.table_to_df(\"prueba\").ext.display()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
INCIDENT_NUMBEROFFENSE_CODEOFFENSE_CODE_GROUPOFFENSE_DESCRIPTIONDISTRICTREPORTING_AREASHOOTINGOCCURRED_ON_DATEYEARMONTHDAY_OF_WEEKHOURUCR_PARTSTREETLatLongLocation
0I18207094500619LarcenyLARCENY ALL OTHERSD148082018-09-02 13:00:0020189Sunday13Part OneLINCOLN ST42.35779134-71.13937053(42.35779134, -71.13937053)
1I18207094301402VandalismVANDALISMC113472018-08-21 00:00:0020188Tuesday0Part TwoHECLA ST42.30682138-71.06030035(42.30682138, -71.06030035)
2I18207094103410TowedTOWED MOTOR VEHICLED41512018-09-03 19:27:0020189Monday19Part ThreeCAZENOVE ST42.34658879-71.07242943(42.34658879, -71.07242943)
3I18207094003114Investigate PropertyINVESTIGATE PROPERTYD42722018-09-03 21:16:0020189Monday21Part ThreeNEWCOMB ST42.33418175-71.07866441(42.33418175, -71.07866441)
4I18207093803114Investigate PropertyINVESTIGATE PROPERTYB34212018-09-03 21:05:0020189Monday21Part ThreeDELHI ST42.27536542-71.09036101(42.27536542, -71.09036101)
5I18207093603820Motor Vehicle Accident ResponseM/V ACCIDENT INVOLVING PEDESTRIAN - INJURYC113982018-09-03 21:09:0020189Monday21Part ThreeTALBOT AVE42.29019621-71.07159012(42.29019621, -71.07159012)
6I18207093300724Auto TheftAUTO THEFTB23302018-09-03 21:25:0020189Monday21Part OneNORMANDY ST42.30607218-71.08273260(42.30607218, -71.08273260)
7I18207093203301Verbal DisputesVERBAL DISPUTEB25842018-09-03 20:39:3720189Monday20Part ThreeLAWN ST42.32701648-71.10555088(42.32701648, -71.10555088)
8I18207093100301RobberyROBBERY - STREETC61772018-09-03 20:48:0020189Monday20Part OneMASSACHUSETTS AVE42.33152148-71.07085307(42.33152148, -71.07085307)
9I18207092903301Verbal DisputesVERBAL DISPUTEC113642018-09-03 20:38:0020189Monday20Part ThreeLESLIE ST42.29514664-71.05860832(42.29514664, -71.05860832)
\n", "
" ], "text/plain": [ " INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n", "0 I182070945 00619 Larceny \n", "1 I182070943 01402 Vandalism \n", "2 I182070941 03410 Towed \n", "3 I182070940 03114 Investigate Property \n", "4 I182070938 03114 Investigate Property \n", "5 I182070936 03820 Motor Vehicle Accident Response \n", "6 I182070933 00724 Auto Theft \n", "7 I182070932 03301 Verbal Disputes \n", "8 I182070931 00301 Robbery \n", "9 I182070929 03301 Verbal Disputes \n", "\n", " OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA \\\n", "0 LARCENY ALL OTHERS D14 808 \n", "1 VANDALISM C11 347 \n", "2 TOWED MOTOR VEHICLE D4 151 \n", "3 INVESTIGATE PROPERTY D4 272 \n", "4 INVESTIGATE PROPERTY B3 421 \n", "5 M/V ACCIDENT INVOLVING PEDESTRIAN - INJURY C11 398 \n", "6 AUTO THEFT B2 330 \n", "7 VERBAL DISPUTE B2 584 \n", "8 ROBBERY - STREET C6 177 \n", "9 VERBAL DISPUTE C11 364 \n", "\n", " SHOOTING OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK HOUR UCR_PART \\\n", "0 2018-09-02 13:00:00 2018 9 Sunday 13 Part One \n", "1 2018-08-21 00:00:00 2018 8 Tuesday 0 Part Two \n", "2 2018-09-03 19:27:00 2018 9 Monday 19 Part Three \n", "3 2018-09-03 21:16:00 2018 9 Monday 21 Part Three \n", "4 2018-09-03 21:05:00 2018 9 Monday 21 Part Three \n", "5 2018-09-03 21:09:00 2018 9 Monday 21 Part Three \n", "6 2018-09-03 21:25:00 2018 9 Monday 21 Part One \n", "7 2018-09-03 20:39:37 2018 9 Monday 20 Part Three \n", "8 2018-09-03 20:48:00 2018 9 Monday 20 Part One \n", "9 2018-09-03 20:38:00 2018 9 Monday 20 Part Three \n", "\n", " STREET Lat Long Location \n", "0 LINCOLN ST 42.35779134 -71.13937053 (42.35779134, -71.13937053) \n", "1 HECLA ST 42.30682138 -71.06030035 (42.30682138, -71.06030035) \n", "2 CAZENOVE ST 42.34658879 -71.07242943 (42.34658879, -71.07242943) \n", "3 NEWCOMB ST 42.33418175 -71.07866441 (42.33418175, -71.07866441) \n", "4 DELHI ST 42.27536542 -71.09036101 (42.27536542, -71.09036101) \n", "5 TALBOT AVE 42.29019621 -71.07159012 (42.29019621, -71.07159012) \n", "6 NORMANDY ST 42.30607218 -71.08273260 (42.30607218, -71.08273260) \n", "7 LAWN ST 42.32701648 -71.10555088 (42.32701648, -71.10555088) \n", "8 MASSACHUSETTS AVE 42.33152148 -71.07085307 (42.33152148, -71.07085307) \n", "9 LESLIE ST 42.29514664 -71.05860832 (42.29514664, -71.05860832) " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "df1 = df.cols.lower(\"INCIDENT_NUMBER\")" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
INCIDENT_NUMBEROFFENSE_CODEOFFENSE_CODE_GROUPOFFENSE_DESCRIPTIONDISTRICTREPORTING_AREASHOOTINGOCCURRED_ON_DATEYEARMONTHDAY_OF_WEEKHOURUCR_PARTSTREETLatLongLocation
0I18207094500619LarcenyLARCENY ALL OTHERSD148082018-09-02 13:00:0020189Sunday13Part OneLINCOLN ST42.35779134-71.13937053(42.35779134, -71.13937053)
1I18207094301402VandalismVANDALISMC113472018-08-21 00:00:0020188Tuesday0Part TwoHECLA ST42.30682138-71.06030035(42.30682138, -71.06030035)
2I18207094103410TowedTOWED MOTOR VEHICLED41512018-09-03 19:27:0020189Monday19Part ThreeCAZENOVE ST42.34658879-71.07242943(42.34658879, -71.07242943)
3I18207094003114Investigate PropertyINVESTIGATE PROPERTYD42722018-09-03 21:16:0020189Monday21Part ThreeNEWCOMB ST42.33418175-71.07866441(42.33418175, -71.07866441)
4I18207093803114Investigate PropertyINVESTIGATE PROPERTYB34212018-09-03 21:05:0020189Monday21Part ThreeDELHI ST42.27536542-71.09036101(42.27536542, -71.09036101)
......................................................
319068I050310906-0003125Warrant ArrestsWARRANT ARRESTD42852016-06-05 17:25:0020166Sunday17Part ThreeCOVENTRY ST42.33695098-71.08574813(42.33695098, -71.08574813)
319069I030217815-0800111HomicideMURDER, NON-NEGLIGIENT MANSLAUGHTERE185202015-07-09 13:38:0020157Thursday13Part OneRIVER ST42.25592648-71.12317207(42.25592648, -71.12317207)
319070I030217815-0803125Warrant ArrestsWARRANT ARRESTE185202015-07-09 13:38:0020157Thursday13Part ThreeRIVER ST42.25592648-71.12317207(42.25592648, -71.12317207)
319071I010370257-0003125Warrant ArrestsWARRANT ARRESTE135692016-05-31 19:35:0020165Tuesday19Part ThreeNEW WASHINGTON ST42.30233307-71.11156487(42.30233307, -71.11156487)
31907214205255003125Warrant ArrestsWARRANT ARRESTD49032015-06-22 00:12:0020156Monday0Part ThreeWASHINGTON ST42.33383935-71.08029038(42.33383935, -71.08029038)
\n", "

319073 rows × 17 columns

\n", "
" ], "text/plain": [ " INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n", "0 I182070945 00619 Larceny \n", "1 I182070943 01402 Vandalism \n", "2 I182070941 03410 Towed \n", "3 I182070940 03114 Investigate Property \n", "4 I182070938 03114 Investigate Property \n", "... ... ... ... \n", "319068 I050310906-00 03125 Warrant Arrests \n", "319069 I030217815-08 00111 Homicide \n", "319070 I030217815-08 03125 Warrant Arrests \n", "319071 I010370257-00 03125 Warrant Arrests \n", "319072 142052550 03125 Warrant Arrests \n", "\n", " OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n", "0 LARCENY ALL OTHERS D14 808 \n", "1 VANDALISM C11 347 \n", "2 TOWED MOTOR VEHICLE D4 151 \n", "3 INVESTIGATE PROPERTY D4 272 \n", "4 INVESTIGATE PROPERTY B3 421 \n", "... ... ... ... ... \n", "319068 WARRANT ARREST D4 285 \n", "319069 MURDER, NON-NEGLIGIENT MANSLAUGHTER E18 520 \n", "319070 WARRANT ARREST E18 520 \n", "319071 WARRANT ARREST E13 569 \n", "319072 WARRANT ARREST D4 903 \n", "\n", " OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK HOUR UCR_PART \\\n", "0 2018-09-02 13:00:00 2018 9 Sunday 13 Part One \n", "1 2018-08-21 00:00:00 2018 8 Tuesday 0 Part Two \n", "2 2018-09-03 19:27:00 2018 9 Monday 19 Part Three \n", "3 2018-09-03 21:16:00 2018 9 Monday 21 Part Three \n", "4 2018-09-03 21:05:00 2018 9 Monday 21 Part Three \n", "... ... ... ... ... ... ... \n", "319068 2016-06-05 17:25:00 2016 6 Sunday 17 Part Three \n", "319069 2015-07-09 13:38:00 2015 7 Thursday 13 Part One \n", "319070 2015-07-09 13:38:00 2015 7 Thursday 13 Part Three \n", "319071 2016-05-31 19:35:00 2016 5 Tuesday 19 Part Three \n", "319072 2015-06-22 00:12:00 2015 6 Monday 0 Part Three \n", "\n", " STREET Lat Long \\\n", "0 LINCOLN ST 42.35779134 -71.13937053 \n", "1 HECLA ST 42.30682138 -71.06030035 \n", "2 CAZENOVE ST 42.34658879 -71.07242943 \n", "3 NEWCOMB ST 42.33418175 -71.07866441 \n", "4 DELHI ST 42.27536542 -71.09036101 \n", "... ... ... ... \n", "319068 COVENTRY ST 42.33695098 -71.08574813 \n", "319069 RIVER ST 42.25592648 -71.12317207 \n", "319070 RIVER ST 42.25592648 -71.12317207 \n", "319071 NEW WASHINGTON ST 42.30233307 -71.11156487 \n", "319072 WASHINGTON ST 42.33383935 -71.08029038 \n", "\n", " Location \n", "0 (42.35779134, -71.13937053) \n", "1 (42.30682138, -71.06030035) \n", "2 (42.34658879, -71.07242943) \n", "3 (42.33418175, -71.07866441) \n", "4 (42.27536542, -71.09036101) \n", "... ... \n", "319068 (42.33695098, -71.08574813) \n", "319069 (42.25592648, -71.12317207) \n", "319070 (42.25592648, -71.12317207) \n", "319071 (42.30233307, -71.11156487) \n", "319072 (42.33383935, -71.08029038) \n", "\n", "[319073 rows x 17 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.to_pandas()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
Viewing 10 of 319073 rows / 17 columns
\n", "
N/A partition(s)
\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
INCIDENT_NUMBER
\n", "
1 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
OFFENSE_CODE
\n", "
2 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
OFFENSE_CODE_GROUP
\n", "
3 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
OFFENSE_DESCRIPTION
\n", "
4 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
DISTRICT
\n", "
5 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
REPORTING_AREA
\n", "
6 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
SHOOTING
\n", "
7 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
OCCURRED_ON_DATE
\n", "
8 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
YEAR
\n", "
9 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
MONTH
\n", "
10 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
DAY_OF_WEEK
\n", "
11 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
HOUR
\n", "
12 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
UCR_PART
\n", "
13 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
STREET
\n", "
14 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
Lat
\n", "
15 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
Long
\n", "
16 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
Location
\n", "
17 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070945\n", " \n", "
\n", "
\n", "
\n", " \n", " 00619\n", " \n", "
\n", "
\n", "
\n", " \n", " Larceny\n", " \n", "
\n", "
\n", "
\n", " \n", " larceny⋅all⋅others\n", " \n", "
\n", "
\n", "
\n", " \n", " D14\n", " \n", "
\n", "
\n", "
\n", " \n", " 808\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-02⋅13:00:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Sunday\n", " \n", "
\n", "
\n", "
\n", " \n", " 13\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅One\n", " \n", "
\n", "
\n", "
\n", " \n", " LINCOLN⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.35779134\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.13937053\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.35779134,⋅-71.13937053)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070943\n", " \n", "
\n", "
\n", "
\n", " \n", " 01402\n", " \n", "
\n", "
\n", "
\n", " \n", " Vandalism\n", " \n", "
\n", "
\n", "
\n", " \n", " vandalism\n", " \n", "
\n", "
\n", "
\n", " \n", " C11\n", " \n", "
\n", "
\n", "
\n", " \n", " 347\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-08-21⋅00:00:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 8\n", " \n", "
\n", "
\n", "
\n", " \n", " Tuesday\n", " \n", "
\n", "
\n", "
\n", " \n", " 0\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Two\n", " \n", "
\n", "
\n", "
\n", " \n", " HECLA⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.30682138\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.06030035\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.30682138,⋅-71.06030035)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070941\n", " \n", "
\n", "
\n", "
\n", " \n", " 03410\n", " \n", "
\n", "
\n", "
\n", " \n", " Towed\n", " \n", "
\n", "
\n", "
\n", " \n", " towed⋅motor⋅vehicle\n", " \n", "
\n", "
\n", "
\n", " \n", " D4\n", " \n", "
\n", "
\n", "
\n", " \n", " 151\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅19:27:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 19\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Three\n", " \n", "
\n", "
\n", "
\n", " \n", " CAZENOVE⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.34658879\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.07242943\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.34658879,⋅-71.07242943)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070940\n", " \n", "
\n", "
\n", "
\n", " \n", " 03114\n", " \n", "
\n", "
\n", "
\n", " \n", " Investigate⋅Property\n", " \n", "
\n", "
\n", "
\n", " \n", " investigate⋅property\n", " \n", "
\n", "
\n", "
\n", " \n", " D4\n", " \n", "
\n", "
\n", "
\n", " \n", " 272\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅21:16:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 21\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Three\n", " \n", "
\n", "
\n", "
\n", " \n", " NEWCOMB⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.33418175\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.07866441\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.33418175,⋅-71.07866441)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070938\n", " \n", "
\n", "
\n", "
\n", " \n", " 03114\n", " \n", "
\n", "
\n", "
\n", " \n", " Investigate⋅Property\n", " \n", "
\n", "
\n", "
\n", " \n", " investigate⋅property\n", " \n", "
\n", "
\n", "
\n", " \n", " B3\n", " \n", "
\n", "
\n", "
\n", " \n", " 421\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅21:05:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 21\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Three\n", " \n", "
\n", "
\n", "
\n", " \n", " DELHI⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.27536542\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.09036101\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.27536542,⋅-71.09036101)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070936\n", " \n", "
\n", "
\n", "
\n", " \n", " 03820\n", " \n", "
\n", "
\n", "
\n", " \n", " Motor⋅Vehicle⋅Accident⋅Response\n", " \n", "
\n", "
\n", "
\n", " \n", " m/v⋅accident⋅involving⋅pedestrian⋅-⋅injury\n", " \n", "
\n", "
\n", "
\n", " \n", " C11\n", " \n", "
\n", "
\n", "
\n", " \n", " 398\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅21:09:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 21\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Three\n", " \n", "
\n", "
\n", "
\n", " \n", " TALBOT⋅AVE\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.29019621\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.07159012\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.29019621,⋅-71.07159012)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070933\n", " \n", "
\n", "
\n", "
\n", " \n", " 00724\n", " \n", "
\n", "
\n", "
\n", " \n", " Auto⋅Theft\n", " \n", "
\n", "
\n", "
\n", " \n", " auto⋅theft\n", " \n", "
\n", "
\n", "
\n", " \n", " B2\n", " \n", "
\n", "
\n", "
\n", " \n", " 330\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅21:25:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 21\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅One\n", " \n", "
\n", "
\n", "
\n", " \n", " NORMANDY⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.30607218\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.08273260\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.30607218,⋅-71.08273260)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070932\n", " \n", "
\n", "
\n", "
\n", " \n", " 03301\n", " \n", "
\n", "
\n", "
\n", " \n", " Verbal⋅Disputes\n", " \n", "
\n", "
\n", "
\n", " \n", " verbal⋅dispute\n", " \n", "
\n", "
\n", "
\n", " \n", " B2\n", " \n", "
\n", "
\n", "
\n", " \n", " 584\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅20:39:37\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 20\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅Three\n", " \n", "
\n", "
\n", "
\n", " \n", " LAWN⋅ST\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.32701648\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.10555088\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.32701648,⋅-71.10555088)\n", " \n", "
\n", "
\n", "
\n", " \n", " I182070931\n", " \n", "
\n", "
\n", "
\n", " \n", " 00301\n", " \n", "
\n", "
\n", "
\n", " \n", " Robbery\n", " \n", "
\n", "
\n", "
\n", " \n", " robbery⋅-⋅street\n", " \n", "
\n", "
\n", "
\n", " \n", " C6\n", " \n", "
\n", "
\n", "
\n", " \n", " 177\n", " \n", "
\n", "
\n", "
\n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " 2018-09-03⋅20:48:00\n", " \n", "
\n", "
\n", "
\n", " \n", " 2018\n", " \n", "
\n", "
\n", "
\n", " \n", " 9\n", " \n", "
\n", "
\n", "
\n", " \n", " Monday\n", " \n", "
\n", "
\n", "
\n", " \n", " 20\n", " \n", "
\n", "
\n", "
\n", " \n", " Part⋅One\n", " \n", "
\n", "
\n", "
\n", " \n", " MASSACHUSETTS⋅AVE\n", " \n", "
\n", "
\n", "
\n", " \n", " 42.33152148\n", " \n", "
\n", "
\n", "
\n", " \n", " -71.07085307\n", " \n", "
\n", "
\n", "
\n", " \n", " (42.33152148,⋅-71.07085307)\n", " \n", "
\n", "
\n", "\n", "
Viewing 10 of 319073 rows / 17 columns
\n", "
N/A partition(s) <class 'optimus.engines.pandas.dataframe.PandasDataFrame'>
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.to_optimus_pandas().cols.lower(\"OFFENSE_DESCRIPTION\")" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'profile': {'columns': {'INCIDENT_NUMBER': {'profiler_dtype': {'dtype': 'string'},\n", " 'stats': {'match': 319073,\n", " 'missing': 0,\n", " 'mismatch': 0,\n", " 'profiler_dtype': {'dtype': 'string'},\n", " 'frequency': [{'value': 'I162030584', 'count': 13},\n", " {'value': 'I152080623', 'count': 11},\n", " {'value': 'I172013170', 'count': 10},\n", " {'value': 'I182065208', 'count': 10},\n", " {'value': 'I172096394', 'count': 10},\n", " {'value': 'I162071327', 'count': 9},\n", " {'value': 'I162001871', 'count': 9},\n", " {'value': 'I172056883', 'count': 9},\n", " {'value': 'I172054429', 'count': 9},\n", " {'value': 'I162098170', 'count': 9},\n", " {'value': 'I172022524', 'count': 9},\n", " {'value': 'I152076465', 'count': 8},\n", " {'value': 'I172053616', 'count': 8},\n", " {'value': 'I152105431', 'count': 8},\n", " {'value': 'I162082917', 'count': 8},\n", " {'value': 'I162064331', 'count': 8},\n", " {'value': 'I162056703', 'count': 8},\n", " {'value': 'I130041200-00', 'count': 8},\n", " {'value': 'I162087224', 'count': 8},\n", " {'value': 'I162022140', 'count': 8},\n", " {'value': 'I172069723', 'count': 8},\n", " {'value': 'I162090278', 'count': 8},\n", " {'value': 'I162074826', 'count': 8},\n", " {'value': 'I162078338', 'count': 8},\n", " {'value': 'I152101399', 'count': 7},\n", " {'value': 'I152095733', 'count': 7},\n", " {'value': 'I162054378', 'count': 7},\n", " {'value': 'I152067057', 'count': 7},\n", " {'value': 'I152096998', 'count': 7},\n", " {'value': 'I172018004', 'count': 7},\n", " {'value': 'I162083089', 'count': 7},\n", " {'value': 'I162045680', 'count': 7},\n", " {'value': 'I152071480', 'count': 7}],\n", " 'count_uniques': 282517},\n", " 'dtype': 'object'}},\n", " 'name': None,\n", " 'file_name': None,\n", " 'summary': {'cols_count': 17,\n", " 'rows_count': 319073,\n", " 'dtypes_list': ['object'],\n", " 'total_count_dtypes': 1,\n", " 'missing_count': 0,\n", " 'p_missing': 0.0}},\n", " 'transformations': {'actions': []}}" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.meta" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
Viewing 10 of 319073 rows / 1 columns
\n", "
1 partition(s)
\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
INCIDENT_NUMBER
\n", "
1 (object)
\n", "
\n", " \n", " not nullable\n", " \n", "
\n", "
\n", "
\n", " \n", " I182016471\n", " \n", "
\n", "
\n", "
\n", " \n", " I182062395\n", " \n", "
\n", "
\n", "
\n", " \n", " I162052877\n", " \n", "
\n", "
\n", "
\n", " \n", " I162067216\n", " \n", "
\n", "
\n", "
\n", " \n", " I172079919\n", " \n", "
\n", "
\n", "
\n", " \n", " I162027167\n", " \n", "
\n", "
\n", "
\n", " \n", " I162039177\n", " \n", "
\n", "
\n", "
\n", " \n", " I172093225\n", " \n", "
\n", "
\n", "
\n", " \n", " I162030885\n", " \n", "
\n", "
\n", "
\n", " \n", " I162028326\n", " \n", "
\n", "
\n", "\n", "
Viewing 10 of 319073 rows / 1 columns
\n", "
1 partition(s) <class 'optimus.engines.dask.dataframe.DaskDataFrame'>
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[0]" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
INCIDENT_NUMBEROFFENSE_CODEOFFENSE_CODE_GROUPOFFENSE_DESCRIPTIONDISTRICTREPORTING_AREASHOOTINGOCCURRED_ON_DATEYEARMONTHDAY_OF_WEEKHOURUCR_PARTSTREETLatLongLocation
0larceny00619LarcenyLARCENY ALL OTHERSD148082018-09-02 13:00:0020189Sunday13Part OneLINCOLN ST42.35779134-71.13937053(42.35779134, -71.13937053)
1I18207094301402VandalismVANDALISMC113472018-08-21 00:00:0020188Tuesday0Part TwoHECLA ST42.30682138-71.06030035(42.30682138, -71.06030035)
2I18207094103410TowedTOWED MOTOR VEHICLED41512018-09-03 19:27:0020189Monday19Part ThreeCAZENOVE ST42.34658879-71.07242943(42.34658879, -71.07242943)
3I18207094003114Investigate PropertyINVESTIGATE PROPERTYD42722018-09-03 21:16:0020189Monday21Part ThreeNEWCOMB ST42.33418175-71.07866441(42.33418175, -71.07866441)
4I18207093803114Investigate PropertyINVESTIGATE PROPERTYB34212018-09-03 21:05:0020189Monday21Part ThreeDELHI ST42.27536542-71.09036101(42.27536542, -71.09036101)
......................................................
319068I050310906-0003125Warrant ArrestsWARRANT ARRESTD42852016-06-05 17:25:0020166Sunday17Part ThreeCOVENTRY ST42.33695098-71.08574813(42.33695098, -71.08574813)
319069I030217815-0800111HomicideMURDER, NON-NEGLIGIENT MANSLAUGHTERE185202015-07-09 13:38:0020157Thursday13Part OneRIVER ST42.25592648-71.12317207(42.25592648, -71.12317207)
319070I030217815-0803125Warrant ArrestsWARRANT ARRESTE185202015-07-09 13:38:0020157Thursday13Part ThreeRIVER ST42.25592648-71.12317207(42.25592648, -71.12317207)
319071I010370257-0003125Warrant ArrestsWARRANT ARRESTE135692016-05-31 19:35:0020165Tuesday19Part ThreeNEW WASHINGTON ST42.30233307-71.11156487(42.30233307, -71.11156487)
31907214205255003125Warrant ArrestsWARRANT ARRESTD49032015-06-22 00:12:0020156Monday0Part ThreeWASHINGTON ST42.33383935-71.08029038(42.33383935, -71.08029038)
\n", "

319073 rows × 17 columns

\n", "
" ], "text/plain": [ " INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n", "0 larceny 00619 Larceny \n", "1 I182070943 01402 Vandalism \n", "2 I182070941 03410 Towed \n", "3 I182070940 03114 Investigate Property \n", "4 I182070938 03114 Investigate Property \n", "... ... ... ... \n", "319068 I050310906-00 03125 Warrant Arrests \n", "319069 I030217815-08 00111 Homicide \n", "319070 I030217815-08 03125 Warrant Arrests \n", "319071 I010370257-00 03125 Warrant Arrests \n", "319072 142052550 03125 Warrant Arrests \n", "\n", " OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n", "0 LARCENY ALL OTHERS D14 808 \n", "1 VANDALISM C11 347 \n", "2 TOWED MOTOR VEHICLE D4 151 \n", "3 INVESTIGATE PROPERTY D4 272 \n", "4 INVESTIGATE PROPERTY B3 421 \n", "... ... ... ... ... \n", "319068 WARRANT ARREST D4 285 \n", "319069 MURDER, NON-NEGLIGIENT MANSLAUGHTER E18 520 \n", "319070 WARRANT ARREST E18 520 \n", "319071 WARRANT ARREST E13 569 \n", "319072 WARRANT ARREST D4 903 \n", "\n", " OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK HOUR UCR_PART \\\n", "0 2018-09-02 13:00:00 2018 9 Sunday 13 Part One \n", "1 2018-08-21 00:00:00 2018 8 Tuesday 0 Part Two \n", "2 2018-09-03 19:27:00 2018 9 Monday 19 Part Three \n", "3 2018-09-03 21:16:00 2018 9 Monday 21 Part Three \n", "4 2018-09-03 21:05:00 2018 9 Monday 21 Part Three \n", "... ... ... ... ... ... ... \n", "319068 2016-06-05 17:25:00 2016 6 Sunday 17 Part Three \n", "319069 2015-07-09 13:38:00 2015 7 Thursday 13 Part One \n", "319070 2015-07-09 13:38:00 2015 7 Thursday 13 Part Three \n", "319071 2016-05-31 19:35:00 2016 5 Tuesday 19 Part Three \n", "319072 2015-06-22 00:12:00 2015 6 Monday 0 Part Three \n", "\n", " STREET Lat Long \\\n", "0 LINCOLN ST 42.35779134 -71.13937053 \n", "1 HECLA ST 42.30682138 -71.06030035 \n", "2 CAZENOVE ST 42.34658879 -71.07242943 \n", "3 NEWCOMB ST 42.33418175 -71.07866441 \n", "4 DELHI ST 42.27536542 -71.09036101 \n", "... ... ... ... \n", "319068 COVENTRY ST 42.33695098 -71.08574813 \n", "319069 RIVER ST 42.25592648 -71.12317207 \n", "319070 RIVER ST 42.25592648 -71.12317207 \n", "319071 NEW WASHINGTON ST 42.30233307 -71.11156487 \n", "319072 WASHINGTON ST 42.33383935 -71.08029038 \n", "\n", " Location \n", "0 (42.35779134, -71.13937053) \n", "1 (42.30682138, -71.06030035) \n", "2 (42.34658879, -71.07242943) \n", "3 (42.33418175, -71.07866441) \n", "4 (42.27536542, -71.09036101) \n", "... ... \n", "319068 (42.33695098, -71.08574813) \n", "319069 (42.25592648, -71.12317207) \n", "319070 (42.25592648, -71.12317207) \n", "319071 (42.30233307, -71.11156487) \n", "319072 (42.33383935, -71.08029038) \n", "\n", "[319073 rows x 17 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import dask\n", "from dask.dataframe import from_delayed\n", "\n", "\n", "def oset(col_name, expr, where):\n", " \n", " where = (where.data[where.cols.names(0)[0]]).to_delayed()\n", " ddf = df.to_delayed()\n", " \n", " def func(_df, _col_name, _mask):\n", " \n", " _df.loc[_mask,[_col_name]]=expr(_df)\n", " return _df\n", "\n", " for _part,_mask in zip(ddf, where):\n", " delayed_parts = dask.delayed(func)(_part, col_name, _mask)\n", "\n", " return from_delayed(delayed_parts)\n", "\n", "col_name=\"INCIDENT_NUMBER\"\n", "where= ((df[col_name]==\"I182070945\") | (df[\"DISTRICT\"]==\"I182070945\"))\n", "F = df.functions\n", "\n", "def expr(series):\n", " return F.lower(series[\"OFFENSE_CODE_GROUP\"])\n", "\n", "\n", "oset(col_name, expr, where).compute()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }