Skip to content

Commit

Permalink
Fix database to use local for testing. I think we have a reqs issue. …
Browse files Browse the repository at this point in the history
…Now conversions to geopandas are failing locally when the API tests passed in general before
  • Loading branch information
micah-prime committed Jun 3, 2024
1 parent 93d23c6 commit 1856756
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nbsphinx==0.8.5
nbsphinx==0.9.4
sphinx-gallery==0.9.0
nbconvert>=6.4.3,<6.5.0
sphinx==4.0.2
sphinx~=7.3
pandoc==1.0.2
ipython>7.0,<9.0
sphinxcontrib-apidoc==0.3.0
Expand Down
2 changes: 1 addition & 1 deletion snowexsql/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LargeQueryCheckException(RuntimeError):
def db_session(db_name):
# use default_name
db_name = db_name or DB_NAME
engine, session = get_db(DB_NAME)
engine, session = get_db(db_name)
yield session, engine
session.close()

Expand Down
4 changes: 2 additions & 2 deletions snowexsql/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def points_to_geopandas(results):

def query_to_geopandas(query, engine, **kwargs):
"""
Convert a GeoAlchemy2 Query meant for postgis to a geopandas dataframe. Requires that a geometry column is
included
Convert a GeoAlchemy2 Query meant for postgis to a geopandas dataframe.
Requires that a geometry column is included
Args:
query: GeoAlchemy2.Query Object
Expand Down
3 changes: 2 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def clz(self, db, db_url):
"""
Extend the class and overwrite the database name
"""
url = db.url
class Extended(self.CLZ):
DB_NAME = db_url
DB_NAME = f"{url.username}:{url.password}@{url.host}/{url.database}"

yield Extended

Expand Down

0 comments on commit 1856756

Please sign in to comment.