Skip to content

Commit

Permalink
Merge pull request #1427 from coolalexzb/master
Browse files Browse the repository at this point in the history
Improve retriever autocreate #1403
  • Loading branch information
henrykironde committed Feb 24, 2020
2 parents 0d9c16c + 4134e26 commit 26e321c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion retriever/lib/create_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def create_resources(file, skip_lines):
resource_dict = {}
path_to_table = os.path.basename(clean_table["name"])
print("Processing... {file_name}".format(file_name=path_to_table))
resource_dict["name"] = os.path.splitext(path_to_table)[0].lower()
path_raw = os.path.splitext(path_to_table)[0].lower()
path_underscore = path_raw.translate(path_raw.maketrans("-. ", "___"))
resource_dict["name"] = '_'.join(filter(None, path_underscore.split('_')))
resource_dict["path"] = path_to_table
resource_dict["schema"] = {}
resource_dict["dialect"] = {"delimiter": ","}
Expand Down

0 comments on commit 26e321c

Please sign in to comment.