Skip to content

Commit 87a0a62

Browse files
committed
Switched from select_object to get_object
Some files are too large for select, and were we always selecting the whole file so no reason for select anyway.
1 parent d1ca447 commit 87a0a62

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ingest/lcsV2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
StringIteratorIO,
2323
fix_units,
2424
load_fetchlogs,
25-
select_object,
25+
get_object,
2626
get_file,
2727
)
2828

@@ -362,7 +362,7 @@ def load_key(self, key, fetchlogs_id, last_modified):
362362
if os.path.exists(os.path.expanduser(key)):
363363
content = get_file(os.path.expanduser(key)).read()
364364
else:
365-
content = select_object(key)
365+
content = get_object(key)
366366

367367
if is_json:
368368
logger.debug(f"Read JSON containing {len(content)} characters")
@@ -815,7 +815,7 @@ def load_metadata(keys):
815815

816816
def get_measurements(key, fetchlogsId):
817817
start = time()
818-
content = select_object(key)
818+
content = get_object(key)
819819
fetch_time = time() - start
820820

821821
ret = []

ingest/settings.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
from pathlib import Path
1111
from os import environ
1212

13+
def get_env():
14+
parent = Path(__file__).resolve().parent.parent
15+
env_file = Path.joinpath(parent, environ.get("DOTENV", ".env"))
16+
return env_file
17+
1318

1419
class Settings(BaseSettings):
1520
DATABASE_READ_USER: str
@@ -40,7 +45,9 @@ def DATABASE_WRITE_URL(self) -> str:
4045
return f"postgresql://{self.DATABASE_WRITE_USER}:{self.DATABASE_WRITE_PASSWORD}@{self.DATABASE_HOST}:{self.DATABASE_PORT}/{self.DATABASE_DB}"
4146

4247
model_config = SettingsConfigDict(
43-
extra="ignore", env_file=f"{environ.get('DOTENV', '.env')}", env_file_encoding="utf-8"
48+
extra="ignore",
49+
env_file=get_env(),
50+
env_file_encoding="utf-8",
4451
)
4552

4653

0 commit comments

Comments
 (0)