Skip to content
Open
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
1 change: 1 addition & 0 deletions scraper/.python-version
Copy link
Copy Markdown
Owner

@aardjon aardjon May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the .python_version file should be added to the repository, so please remove it from your change.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DbSchemaV1Filter(SinkFilter):
particular schema version.
"""

_DB_FILE_NAME: Final = "routedb_v1.sqlite"
_DB_FILE_NAME: Final = f"routedb_v1-{datetime.datetime.now(tz=datetime.UTC).date().today().strftime('%Y-%m-%d')}.sqlite"
""" File name to use for the destination database file. """

def __init__(self, output_directory: Path, database_boundary: RelationalDatabaseBoundary):
Expand Down
8 changes: 5 additions & 3 deletions scraper/test/integration/test_filter_dbcreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from trad.kernel.entities.ranked import RankedValue
from trad.kernel.entities.routedata import Post, Route, Summit

DB_FILE_NAME: Final = f"routedb_v1-{datetime.datetime.now(tz=datetime.UTC).date().today().strftime('%Y-%m-%d')}.sqlite"


def test_schema_v1_db_creation(tmp_path: Path) -> None:
"""
Expand Down Expand Up @@ -58,7 +60,7 @@ def test_schema_v1_db_creation(tmp_path: Path) -> None:
db_writer = DbSchemaV1Filter(output_directory=tmp_path, database_boundary=Sqlite3Database())
db_writer.execute_filter(input_pipe=input_pipe, output_pipe=Mock(Pipe))

expected_db_file = tmp_path.joinpath("routedb_v1.sqlite")
expected_db_file = tmp_path.joinpath(DB_FILE_NAME)
assert expected_db_file.exists()

connection = connect(str(expected_db_file))
Expand Down Expand Up @@ -107,7 +109,7 @@ def test_schema_v1_metadata_creation(tmp_path: Path) -> None:
db_writer = DbSchemaV1Filter(output_directory=tmp_path, database_boundary=Sqlite3Database())
db_writer.execute_filter(input_pipe=pipe, output_pipe=Mock(Pipe))

expected_db_file = tmp_path.joinpath("routedb_v1.sqlite")
expected_db_file = tmp_path.joinpath(DB_FILE_NAME)
assert expected_db_file.exists()

connection = connect(str(expected_db_file))
Expand Down Expand Up @@ -172,7 +174,7 @@ def test_data_enrichment(tmp_path: Path) -> None:
output_filter = DbSchemaV1Filter(output_directory=tmp_path, database_boundary=Sqlite3Database())
output_filter.execute_filter(input_pipe=intermediate_pipe, output_pipe=Mock(Pipe))

expected_db_file = tmp_path.joinpath("routedb_v1.sqlite")
expected_db_file = tmp_path.joinpath(DB_FILE_NAME)
assert expected_db_file.exists()

# Ensure that the Summit exists with the coordinates from the second call
Expand Down