Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Jul 18, 2022
1 parent 9524666 commit 30f3901
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changes
=======

0.7.0 (2022-07-)
0.7.0 (2022-07-18)
------------------
- bcdata.define_request function renamed to define_requests, returns list of
parsed urls rather than a list of request parameter dictionaries - this makes
Expand Down
2 changes: 1 addition & 1 deletion bcdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .wcs import get_dem


__version__ = "0.7.0dev0"
__version__ = "0.7.0"

BCDC_API_URL = "https://catalogue.data.gov.bc.ca/api/3/action/"
WFS_URL = "https://openmaps.gov.bc.ca/geo/pub/wfs"
Expand Down
17 changes: 11 additions & 6 deletions bcdata/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,17 @@ def define_table(
schema=schema_name,
)

# if append not noted, drop any existing table and create the new table
if not append:
if schema_name not in self.schemas:
self.create_schema(schema_name)
if schema_name + "." + table_name in self.tables:
self.drop_table(schema_name, table_name)
if schema_name not in self.schemas:
self.create_schema(schema_name)

# drop existing table if append is not flagged
if schema_name + "." + table_name in self.tables and not append:
log.info("Table {schema_name}.{table_name} exists, overwriting")
self.drop_table(schema_name, table_name)

# create the table
if schema_name + "." + table_name not in self.tables:
log.info("Creating table {schema_name}.{table_name}")
table.create()

return table

0 comments on commit 30f3901

Please sign in to comment.