Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild GA to match scraper #199

Merged
merged 1 commit into from
Sep 18, 2023
Merged
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
29 changes: 26 additions & 3 deletions warn_transformer/transformers/ga.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import typing

from ..schema import BaseTransformer


Expand All @@ -7,8 +9,29 @@ class Transformer(BaseTransformer):
postal_code = "GA"
fields = dict(
company="Company Name",
location="City",
effective_date="Separation Date",
jobs="Est. Impact",
location=lambda row: row["First Location Address"] or row["County"],
effective_date="First Date of Separation",
jobs="Total Number of Affected Employees",
)
date_format = "%m/%d/%Y"

# This needs to be checked -- no temporary data to test against
def check_if_temporary(self, row: typing.Dict) -> typing.Optional[bool]:
"""Determine whether a row is a temporary or not.

Args:
row (dict): The raw row of data.

Returns: A boolean or null
"""
return "temporary" in row["Type of Layoff or Closure"].lower() or None

def check_if_closure(self, row: typing.Dict) -> typing.Optional[bool]:
"""Determine whether a row is a closure or not.

Args:
row (dict): The raw row of data.

Returns: A boolean or null
"""
return "closure" in row["Type of Layoff or Closure"].lower() or None
Loading