Skip to content

Commit 476944d

Browse files
committed
Merge branch 'master' of https://github.com/EMPD2/EMPD-data into empd1
2 parents 0bb07d6 + 9c1a1df commit 476944d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

postgres/scripts/import_into_empd2.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def clean_doi(doi):
9898
save_orig = True
9999

100100
if save_orig:
101-
orig_METADATA.to_csv(meta, sep='\t', index=False, float_format='%1.8g')
101+
try:
102+
orig_METADATA.to_csv(meta, sep='\t', index=False, float_format='%1.8g')
103+
except PermissionError:
104+
pass
102105

103106
table_map = {
104107
'Country': 'countries',
@@ -123,7 +126,10 @@ def clean_doi(doi):
123126
'({})'.format(', '.join(map(is_null_str, v)))
124127
for v in new_vals)))
125128
conn.commit()
126-
df.to_csv(fname, sep='\t', index=False)
129+
try:
130+
df.to_csv(fname, sep='\t', index=False)
131+
except PermissionError:
132+
pass
127133

128134

129135
METADATA.replace(np.nan, '', inplace=True)

0 commit comments

Comments
 (0)