Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌲 Dbot updates, handful of fixes, etc #117

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
keywords=["gis"],
install_requires=[
"arcgis==2.3.*",
"arcgis>=2.3,<2.5",
"geopandas>=0.14,<1.1",
"geodatasets>=2023.12,<2024.9",
"pg8000>=1.29,<1.32",
Expand Down
5 changes: 1 addition & 4 deletions src/palletjack/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def __init__(self, host, database, username, password, port=5432):

self._class_logger = logging.getLogger(__name__).getChild(self.__class__.__name__)
if utils.is_running_in_gcp():
self._class_logger.info("running in GCF, using unix socket")
self._class_logger.info("running in GCP, using unix socket")
self.engine = sqlalchemy.create_engine(
sqlalchemy.engine.url.URL.create(
drivername="postgresql+pg8000",
Expand Down Expand Up @@ -543,9 +543,6 @@ def read_table_into_dataframe(self, table_name, index_column, crs, spatial_colum
)

spatial_dataframe = pd.DataFrame.spatial.from_geodataframe(dataframe, column_name=spatial_column)
for column in spatial_dataframe.select_dtypes(include=["datetime64[ns, UTC]"]):
self._class_logger.debug("Converting column `%s` to ISO string format", column)
spatial_dataframe[column] = spatial_dataframe[column].apply(pd.Timestamp.isoformat)

self._class_logger.debug("Dataframe shape: %s", spatial_dataframe.shape)
if len(spatial_dataframe.index) == 0:
Expand Down
2 changes: 1 addition & 1 deletion src/palletjack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def sedf_to_gdf(dataframe):
gdf = gpd.GeoDataFrame(dataframe, geometry=dataframe.spatial.name)
try:
gdf.set_crs(dataframe.spatial.sr["latestWkid"], inplace=True)
except KeyError:
except AttributeError:
gdf.set_crs(dataframe.spatial.sr["wkid"], inplace=True)

return gdf
Expand Down
Loading