rkiddy / ca_hhs

The California Health and Human Services department publishes data in different formats. These apps will import and display the data. This is a work in progress.
0 stars 0 forks source link

crash in covid-19-sewershed-restricted-case-data #6

Closed rkiddy closed 1 month ago

rkiddy commented 2 months ago
covid-19-sewershed-restricted-case-data
reading ids...
checking deets...
url: https://data.chhs.ca.gov/dataset/covid-19-sewershed-restricted-case-data
writing...
fetching...
Archive:  covid-19-sewershed-restricted-case-data-am9gfag2.zip
  inflating: covid-19-sewershed-restricted-case-data.csv  
  inflating: covid-19-sewershed-restricted-case-data-data-dictionary.xlsx  
  inflating: datapackage.json        
into data...
Traceback (most recent call last):
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'watershed_sites select short_name, full_name, area_type from watershed_cases' at line 1")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/watershed.py", line 96, in <module>
    db_exec(conn, sql)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/watershed.py", line 24, in db_exec
    return eng.execute(this_sql)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1365, in execute
    return self._exec_driver_sql(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1669, in _exec_driver_sql
    ret = self._execute_context(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
    raise exception
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/ray/Projects/ca_hhs/covid-19-sewershed-restricted-case-data/.venv/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'watershed_sites select short_name, full_name, area_type from watershed_cases' at line 1")
[SQL: insert ignore info watershed_sites select short_name, full_name, area_type from watershed_cases]
(Background on this error at: https://sqlalche.me/e/14/f405)
rkiddy commented 1 month ago

No longer a problem.

start
Sun Oct 20 05:00:15 PM PDT 2024
reading ids...
checking deets...
url: https://data.chhs.ca.gov/dataset/covid-19-sewershed-restricted-case-data
writing...
fetching...
Archive:  covid-19-sewershed-restricted-case-data-am9gfag2.zip
  inflating: covid-19-sewershed-restricted-case-data.csv  
  inflating: covid-19-sewershed-restricted-case-data-data-dictionary.xlsx  
  inflating: datapackage.json        
into data...

creating table sewershed_cases...

file: covid-19-sewershed-restricted-case-data.csv -> table: sewershed_cases # 144665

Sun Oct 20 05:03:23 PM PDT 2024
done