alignment

pull/231/head
Yariv Menachem 2024-12-18 17:54:31 +02:00
parent e863199838
commit 5098ac22c2
3 changed files with 5 additions and 6 deletions

View File

@ -79,9 +79,9 @@ class GoozaliMapper:
# Return a new GoozaliResponse with msg and the converted data # Return a new GoozaliResponse with msg and the converted data
return GoozaliResponse(msg=data['msg'], data=data_obj) return GoozaliResponse(msg=data['msg'], data=data_obj)
def get_value_by_job_post_Id(self, job_post_column: str, row: GoozaliRow, dict_column_name_to_columnZ): def get_value_by_job_post_Id(self, job_post_column: str, row: GoozaliRow, dict_column_name_to_column: dict[str, GoozaliColumn]):
goozali_column_name = job_post_column_to_goozali_column[job_post_column] goozali_column_name = job_post_column_to_goozali_column[job_post_column]
column = dict_column_name_to_columnZ[goozali_column_name] column = dict_column_name_to_column[goozali_column_name]
value = row.cellValuesByColumnId[column.id] value = row.cellValuesByColumnId[column.id]
if (job_post_column == "location"): if (job_post_column == "location"):
# todo: fix it # todo: fix it
@ -92,7 +92,7 @@ class GoozaliMapper:
return str(value) return str(value)
def map_goozali_response_to_job_post(self, row: GoozaliRow, dict_column_name_to_column) -> JobPost: def map_goozali_response_to_job_post(self, row: GoozaliRow, dict_column_name_to_column: dict[str, GoozaliColumn]) -> JobPost:
temp = {} temp = {}
for col in job_post_column_names: for col in job_post_column_names:
value = self.get_value_by_job_post_Id( value = self.get_value_by_job_post_Id(

View File

@ -23,8 +23,7 @@ job_post_column_names = ["id",
"location", "location",
"company_industry"] "company_industry"]
# Key mapper: Extract 'name' as the key # Key mapper: Extract 'name' as the key
def extract_goozali_column_name(column): return column.name if isinstance( def extract_goozali_column_name(column): return column.name if isinstance(
column, GoozaliColumn) else None column, GoozaliColumn) else None

View File

@ -36,7 +36,7 @@ try:
response_data.rows, column, column_choice) response_data.rows, column, column_choice)
filtered_rows_by_age_and_column_choice = component.filter_rows_by_hours( filtered_rows_by_age_and_column_choice = component.filter_rows_by_hours(
filtered_rows_by_column_choice, hours_old) filtered_rows_by_column_choice, hours_old)
dict_column_name_to_column = create_dict_by_key_and_value( dict_column_name_to_column: dict[str, GoozaliColumn] = create_dict_by_key_and_value(
response_data.columns, extract_goozali_column_name) response_data.columns, extract_goozali_column_name)
response: list[JobPost] = [] response: list[JobPost] = []
for row in filtered_rows_by_age_and_column_choice: for row in filtered_rows_by_age_and_column_choice: