Skip to content

Commit

Permalink
chmod before create?
Browse files Browse the repository at this point in the history
  • Loading branch information
daviidarr committed Apr 3, 2024
1 parent b6c3593 commit d14a06a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ def __init__(self, config: dict, secrets: dict):
logging.warning(f'Creating new {self.data_location["local_file"]}')
else:
raise e


local_file = self.data_location['local_file']
elif 'data_dir' in config:
# if not, we are using local and the file is already in the data_dir
Expand All @@ -176,8 +174,8 @@ def __init__(self, config: dict, secrets: dict):
else:
raise ValueError('config must contain either bucket_name and filename, or data_dir')
# self.engine = st.experimental_connection(config['data_dir'], type=config['type'], autocommit=True)
os.chmod(local_file, 0o777)
self.conn = sqlite3.connect(local_file, check_same_thread=False)
os.chmod(local_file, 0o777)
self.cursor = self.conn.cursor()

def upload_to_s3(self):
Expand Down

0 comments on commit d14a06a

Please sign in to comment.