Hello,
I am getting an error for my data loader python file based on Job ID: It says “TypeError: Unicode-objects must be encoded before hashing”, does anyone have experience with this error? I am using standard template code for this function:
def getJobId(self):
"""
Return a unique string for each different select
:returns a string
"""
# Generate a stable id that changes with the main parameters
# m = hashlib.sha256()
m = hashlib.blake2b(digest_size=20)
m.update(repr(os.getcwd()))
job_id = m.hexdigest()
log.debug("Job ID: %s", job_id)
return job_id
ERROR:
Traceback (most recent call last):
File "/Users/manutej.mulaveesala/python_virtual_environments/squirro/lib/python3.7/site-packages/squirro/dataloader/sq_data_load.py", line 693, in main
launcher.execute()
File "/Users/manutej.mulaveesala/python_virtual_environments/squirro/lib/python3.7/site-packages/squirro/dataloader/sq_data_load.py", line 472, in execute
self.config.source, cli_mode=cli_mode, max_inc_value=max_inc_value
File "/Users/manutej.mulaveesala/python_virtual_environments/squirro/lib/python3.7/site-packages/squirro/dataloader/sq_data_load.py", line 148, in load_from_source
job_id = self._get_job_id(source, source_name)
File "/Users/manutej.mulaveesala/python_virtual_environments/squirro/lib/python3.7/site-packages/squirro/dataloader/sq_data_load.py", line 337, in _get_job_id
job_id = source.getJobId()
File "nytimes_dataloader.py", line 179, in getJobId
m.update(repr(os.getcwd()))
TypeError: Unicode-objects must be encoded before hashing