Skip to content

Commit

Permalink
Remove redundant files/code
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhany2002 committed Dec 9, 2024
1 parent 4d46012 commit 8e6f3d9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 164 deletions.
13 changes: 0 additions & 13 deletions src/bag/bag_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from django.conf import settings
from django.db import connection
from django.utils.timezone import is_aware, make_aware
from isodate import parse_date, parse_datetime
from toolz import interleave, partial, pipe

Expand All @@ -15,17 +14,6 @@


class BagController:
def create_rijtjeshuizen_tables(self):
files = ["determine_building_units.sql", "cluster_building_dwelling.sql"]
folder = os.path.join(settings.BASE_DIR, "bag/raw_sql")
for file in files:
with open(os.path.join(folder, file), "r") as sql_file:
raw_sql = sql_file.read()

logger.info(f"Creating table from file {file}")
with connection.cursor() as cursor:
cursor.execute(raw_sql)

def create_bag_instances(self, bag_model, row: dict):
bag_dict = {}
for field, value in row.items():
Expand All @@ -42,7 +30,6 @@ def create_bag_instances(self, bag_model, row: dict):
if "T" in value
else datetime.combine(parse_date(value), datetime.now().time())
)
value = value if is_aware(value) else make_aware(value)
bag_dict[field] = value

try:
Expand Down
Empty file removed src/bag/raw_sql/__init__.py
Empty file.
74 changes: 0 additions & 74 deletions src/bag/raw_sql/cluster_building_dwelling.sql

This file was deleted.

72 changes: 0 additions & 72 deletions src/bag/raw_sql/determine_building_units.sql

This file was deleted.

5 changes: 0 additions & 5 deletions src/bag/tests/test_bag_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@


class TestBagController:
@patch("bag.bag_controller.connection.cursor")
def test_create_rijtjeshuizen_tables(self, mock_cursor):
BagController().create_rijtjeshuizen_tables()
assert mock_cursor.call_count == 2

@pytest.mark.django_db
def test_upsert_table_data(self):
obj = baker.prepare(Ligplaats, id="03630000000001", status="Active")
Expand Down

0 comments on commit 8e6f3d9

Please sign in to comment.