-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored scraping to include date and neighbourhood fields
Co-authored-by: Alyssa D'Souza <[email protected]>
- Loading branch information
1 parent
3b8c3d6
commit ece8b23
Showing
12 changed files
with
63 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
from datetime import datetime | ||
import pandas as pd | ||
from sqlalchemy.orm import Session | ||
|
||
from backend.pydantic_schemas.Building import Building as BuildingObj | ||
from backend.db_models import Building | ||
from backend.db_models import Building, Unit | ||
|
||
|
||
def get_building_by_name(db: Session, name: str) -> BuildingObj: | ||
def get_building_by_name(db: Session, name: str): | ||
return db.query(Building).filter_by(name=name).first() | ||
|
||
def get_building_by_lat_lon(db: Session, lat: float, lon: float): | ||
return db.query(Building).filter_by(lat=lat, lon=lon).first() | ||
|
||
def get_building_units_by_timestamp(db: Session, building_id: int, timestamp: datetime): | ||
return db.query(Unit).filter_by(building_id=building_id, timestamp=timestamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters