---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3280, in Engine._wrap_pool_connect(self, fn, connection)
3279 try:
-> 3280 return fn()
3281 except dialect.dbapi.Error as e:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:310, in Pool.connect(self)
303 """Return a DBAPI connection from the pool.
304
305 The connection is instrumented such that when its
(...)
308
309 """
--> 310 return _ConnectionFairy._checkout(self)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:868, in _ConnectionFairy._checkout(cls, pool, threadconns, fairy)
867 if not fairy:
--> 868 fairy = _ConnectionRecord.checkout(pool)
870 fairy._pool = pool
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:476, in _ConnectionRecord.checkout(cls, pool)
474 @classmethod
475 def checkout(cls, pool):
--> 476 rec = pool._do_get()
477 try:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/impl.py:146, in QueuePool._do_get(self)
145 with util.safe_reraise():
--> 146 self._dec_overflow()
147 else:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/langhelpers.py:70, in safe_reraise.__exit__(self, type_, value, traceback)
69 if not self.warn_only:
---> 70 compat.raise_(
71 exc_value,
72 with_traceback=exc_tb,
73 )
74 else:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
207 try:
--> 208 raise exception
209 finally:
210 # credit to
211 # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
212 # as the __traceback__ object creates a cycle
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/impl.py:143, in QueuePool._do_get(self)
142 try:
--> 143 return self._create_connection()
144 except:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:256, in Pool._create_connection(self)
254 """Called by subclasses to create a new ConnectionRecord."""
--> 256 return _ConnectionRecord(self)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:371, in _ConnectionRecord.__init__(self, pool, connect)
370 if connect:
--> 371 self.__connect()
372 self.finalize_callback = deque()
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:666, in _ConnectionRecord.__connect(self)
665 with util.safe_reraise():
--> 666 pool.logger.debug("Error on connect(): %s", e)
667 else:
668 # in SQLAlchemy 1.4 the first_connect event is not used by
669 # the engine, so this will usually not be set
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/langhelpers.py:70, in safe_reraise.__exit__(self, type_, value, traceback)
69 if not self.warn_only:
---> 70 compat.raise_(
71 exc_value,
72 with_traceback=exc_tb,
73 )
74 else:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
207 try:
--> 208 raise exception
209 finally:
210 # credit to
211 # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
212 # as the __traceback__ object creates a cycle
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:661, in _ConnectionRecord.__connect(self)
660 self.starttime = time.time()
--> 661 self.dbapi_connection = connection = pool._invoke_creator(self)
662 pool.logger.debug("Created new connection %r", connection)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/create.py:590, in create_engine.<locals>.connect(connection_record)
589 return connection
--> 590 return dialect.connect(*cargs, **cparams)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/default.py:597, in DefaultDialect.connect(self, *cargs, **cparams)
595 def connect(self, *cargs, **cparams):
596 # inherits the docstring from interfaces.Dialect.connect
--> 597 return self.dbapi.connect(*cargs, **cparams)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/psycopg2/__init__.py:122, in connect(dsn, connection_factory, cursor_factory, **kwargs)
121 dsn = _ext.make_dsn(dsn, **kwargs)
--> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
123 if cursor_factory is not None:
OperationalError: FATAL: no pg_hba.conf entry for host "70.32.23.38", user "fcnzstud_hs", database "fcnzstud_hearthstone", SSL off
The above exception was the direct cause of the following exception:
OperationalError Traceback (most recent call last)
Input In [1], in <cell line: 15>()
13 connection_string = os.environ.get('HSBGDS_CONNECTION_STRING')
14 engine = create_engine(connection_string)
---> 15 timestamp = pd.read_sql("select date(max(captured))-1 captured_date from battleground_ratings",engine)
16 update_date = timestamp.at[0, "captured_date"].strftime("%Y-%m-%d")
17 header_message = "This recap shows you what happened yesterday. Sort by any column you like to see who gained the most rating, climbed the most ranks or had a really, really bad day. "
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/pandas/io/sql.py:592, in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)
583 return pandas_sql.read_table(
584 sql,
585 index_col=index_col,
(...)
589 chunksize=chunksize,
590 )
591 else:
--> 592 return pandas_sql.read_query(
593 sql,
594 index_col=index_col,
595 params=params,
596 coerce_float=coerce_float,
597 parse_dates=parse_dates,
598 chunksize=chunksize,
599 )
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/pandas/io/sql.py:1557, in SQLDatabase.read_query(self, sql, index_col, coerce_float, parse_dates, params, chunksize, dtype)
1509 """
1510 Read SQL query into a DataFrame.
1511
(...)
1553
1554 """
1555 args = _convert_params(sql, params)
-> 1557 result = self.execute(*args)
1558 columns = result.keys()
1560 if chunksize is not None:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/pandas/io/sql.py:1402, in SQLDatabase.execute(self, *args, **kwargs)
1400 def execute(self, *args, **kwargs):
1401 """Simple passthrough to SQLAlchemy connectable"""
-> 1402 return self.connectable.execution_options().execute(*args, **kwargs)
File <string>:2, in execute(self, statement, *multiparams, **params)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/deprecations.py:401, in _decorate_with_warning.<locals>.warned(fn, *args, **kwargs)
399 if not skip_warning:
400 _warn_with_version(message, version, wtype, stacklevel=3)
--> 401 return fn(*args, **kwargs)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3175, in Engine.execute(self, statement, *multiparams, **params)
3149 @util.deprecated_20(
3150 ":meth:`_engine.Engine.execute`",
3151 alternative="All statement execution in SQLAlchemy 2.0 is performed "
(...)
3156 )
3157 def execute(self, statement, *multiparams, **params):
3158 """Executes the given construct and returns a
3159 :class:`_engine.CursorResult`.
3160
(...)
3173
3174 """
-> 3175 connection = self.connect(close_with_result=True)
3176 return connection.execute(statement, *multiparams, **params)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3234, in Engine.connect(self, close_with_result)
3219 def connect(self, close_with_result=False):
3220 """Return a new :class:`_engine.Connection` object.
3221
3222 The :class:`_engine.Connection` object is a facade that uses a DBAPI
(...)
3231
3232 """
-> 3234 return self._connection_cls(self, close_with_result=close_with_result)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:96, in Connection.__init__(self, engine, connection, close_with_result, _branch_from, _execution_options, _dispatch, _has_events, _allow_revalidate)
91 self._has_events = _branch_from._has_events
92 else:
93 self._dbapi_connection = (
94 connection
95 if connection is not None
---> 96 else engine.raw_connection()
97 )
99 self._transaction = self._nested_transaction = None
100 self.__savepoint_seq = 0
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3313, in Engine.raw_connection(self, _connection)
3291 def raw_connection(self, _connection=None):
3292 """Return a "raw" DBAPI connection from the connection pool.
3293
3294 The returned object is a proxied version of the DBAPI
(...)
3311
3312 """
-> 3313 return self._wrap_pool_connect(self.pool.connect, _connection)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3283, in Engine._wrap_pool_connect(self, fn, connection)
3281 except dialect.dbapi.Error as e:
3282 if connection is None:
-> 3283 Connection._handle_dbapi_exception_noconnection(
3284 e, dialect, self
3285 )
3286 else:
3287 util.raise_(
3288 sys.exc_info()[1], with_traceback=sys.exc_info()[2]
3289 )
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:2117, in Connection._handle_dbapi_exception_noconnection(cls, e, dialect, engine)
2115 util.raise_(newraise, with_traceback=exc_info[2], from_=e)
2116 elif should_wrap:
-> 2117 util.raise_(
2118 sqlalchemy_exception, with_traceback=exc_info[2], from_=e
2119 )
2120 else:
2121 util.raise_(exc_info[1], with_traceback=exc_info[2])
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
205 exception.__cause__ = replace_context
207 try:
--> 208 raise exception
209 finally:
210 # credit to
211 # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
212 # as the __traceback__ object creates a cycle
213 del exception, replace_context, from_, with_traceback
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py:3280, in Engine._wrap_pool_connect(self, fn, connection)
3278 dialect = self.dialect
3279 try:
-> 3280 return fn()
3281 except dialect.dbapi.Error as e:
3282 if connection is None:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:310, in Pool.connect(self)
302 def connect(self):
303 """Return a DBAPI connection from the pool.
304
305 The connection is instrumented such that when its
(...)
308
309 """
--> 310 return _ConnectionFairy._checkout(self)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:868, in _ConnectionFairy._checkout(cls, pool, threadconns, fairy)
865 @classmethod
866 def _checkout(cls, pool, threadconns=None, fairy=None):
867 if not fairy:
--> 868 fairy = _ConnectionRecord.checkout(pool)
870 fairy._pool = pool
871 fairy._counter = 0
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:476, in _ConnectionRecord.checkout(cls, pool)
474 @classmethod
475 def checkout(cls, pool):
--> 476 rec = pool._do_get()
477 try:
478 dbapi_connection = rec.get_connection()
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/impl.py:146, in QueuePool._do_get(self)
144 except:
145 with util.safe_reraise():
--> 146 self._dec_overflow()
147 else:
148 return self._do_get()
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/langhelpers.py:70, in safe_reraise.__exit__(self, type_, value, traceback)
68 self._exc_info = None # remove potential circular references
69 if not self.warn_only:
---> 70 compat.raise_(
71 exc_value,
72 with_traceback=exc_tb,
73 )
74 else:
75 if not compat.py3k and self._exc_info and self._exc_info[1]:
76 # emulate Py3K's behavior of telling us when an exception
77 # occurs in an exception handler.
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
205 exception.__cause__ = replace_context
207 try:
--> 208 raise exception
209 finally:
210 # credit to
211 # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
212 # as the __traceback__ object creates a cycle
213 del exception, replace_context, from_, with_traceback
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/impl.py:143, in QueuePool._do_get(self)
141 if self._inc_overflow():
142 try:
--> 143 return self._create_connection()
144 except:
145 with util.safe_reraise():
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:256, in Pool._create_connection(self)
253 def _create_connection(self):
254 """Called by subclasses to create a new ConnectionRecord."""
--> 256 return _ConnectionRecord(self)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:371, in _ConnectionRecord.__init__(self, pool, connect)
369 self.__pool = pool
370 if connect:
--> 371 self.__connect()
372 self.finalize_callback = deque()
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:666, in _ConnectionRecord.__connect(self)
664 except Exception as e:
665 with util.safe_reraise():
--> 666 pool.logger.debug("Error on connect(): %s", e)
667 else:
668 # in SQLAlchemy 1.4 the first_connect event is not used by
669 # the engine, so this will usually not be set
670 if pool.dispatch.first_connect:
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/langhelpers.py:70, in safe_reraise.__exit__(self, type_, value, traceback)
68 self._exc_info = None # remove potential circular references
69 if not self.warn_only:
---> 70 compat.raise_(
71 exc_value,
72 with_traceback=exc_tb,
73 )
74 else:
75 if not compat.py3k and self._exc_info and self._exc_info[1]:
76 # emulate Py3K's behavior of telling us when an exception
77 # occurs in an exception handler.
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/util/compat.py:208, in raise_(***failed resolving arguments***)
205 exception.__cause__ = replace_context
207 try:
--> 208 raise exception
209 finally:
210 # credit to
211 # https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
212 # as the __traceback__ object creates a cycle
213 del exception, replace_context, from_, with_traceback
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/pool/base.py:661, in _ConnectionRecord.__connect(self)
659 try:
660 self.starttime = time.time()
--> 661 self.dbapi_connection = connection = pool._invoke_creator(self)
662 pool.logger.debug("Created new connection %r", connection)
663 self.fresh = True
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/create.py:590, in create_engine.<locals>.connect(connection_record)
588 if connection is not None:
589 return connection
--> 590 return dialect.connect(*cargs, **cparams)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/sqlalchemy/engine/default.py:597, in DefaultDialect.connect(self, *cargs, **cparams)
595 def connect(self, *cargs, **cparams):
596 # inherits the docstring from interfaces.Dialect.connect
--> 597 return self.dbapi.connect(*cargs, **cparams)
File ~/virtualenv/bookbuilder/3.9/lib64/python3.9/site-packages/psycopg2/__init__.py:122, in connect(dsn, connection_factory, cursor_factory, **kwargs)
119 kwasync['async_'] = kwargs.pop('async_')
121 dsn = _ext.make_dsn(dsn, **kwargs)
--> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
123 if cursor_factory is not None:
124 conn.cursor_factory = cursor_factory
OperationalError: (psycopg2.OperationalError) FATAL: no pg_hba.conf entry for host "70.32.23.38", user "fcnzstud_hs", database "fcnzstud_hearthstone", SSL off
(Background on this error at: https://sqlalche.me/e/14/e3q8)