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

import syntax and ckanserviceprovider version #125

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions datapusher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ class DataPusherPlusConfig(MutableMapping):

PREFER_DMY: bool = False
PREVIEW_ROWS: int = 0

AUTO_INDEX_THRESHOLD: int = 3
AUTO_UNIQUE_INDEX:bool = True
AUTO_INDEX_DATES: bool = True

SORT_AND_DUPE_CHECK: bool = True
DEDUP: bool = False
DEFAULT_EXCEL_SHEET: int = 0

UNSAFE_PREFIX: str = "unsafe_"
RESERVED_COLNAMES: str = "_id"

ADD_SUMMARY_STATS_RESOURCE: bool = False
SUMMARY_STATS_OPTIONS: str = ""

AUTO_ALIAS: bool = True
AUTO_ALIAS_UNIQUE: bool = False

Expand Down
6 changes: 3 additions & 3 deletions datapusher/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# CKAN-related imports
from ckanserviceprovider import web
from datapusher.config import config
from .config import config


if locale.getdefaultlocale()[0]:
Expand Down Expand Up @@ -372,7 +372,7 @@ def push_to_datastore(task_id, input, dry_run=False):
with tempfile.TemporaryDirectory() as temp_dir:
return _push_to_datastore(task_id, input, dry_run=dry_run, temp_dir=temp_dir)


def _push_to_datastore(task_id, input, dry_run=False, temp_dir=None):
handler = util.StoringHandler(task_id, input)
logger = logging.getLogger(task_id)
Expand Down Expand Up @@ -669,7 +669,7 @@ def _push_to_datastore(task_id, input, dry_run=False, temp_dir=None):
# using uchardet to determine encoding
file_encoding = subprocess.run(
[
"uchardet",
"uchardet",
tmp.name
],
check=True,
Expand Down
4 changes: 2 additions & 2 deletions datapusher/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import ckanserviceprovider.web as web

from datapusher import jobs
from config import config
from . import jobs
from .config import config

# check whether jobs have been imported properly
assert jobs.push_to_datastore
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
install_requires=[
"APScheduler == 3.9.1.post1",
"python-dotenv",
'ckanserviceprovider == 1.1.0',
'ckanserviceprovider == 1.2.0',
'requests',
"psycopg2-binary",
'datasize',
Expand Down