Skip to content

Do not call logger on None object.#269

Merged
tino097 merged 1 commit into
dathere:mainfrom
pdelboca:fix-logger-error
Feb 18, 2026
Merged

Do not call logger on None object.#269
tino097 merged 1 commit into
dathere:mainfrom
pdelboca:fix-logger-error

Conversation

@pdelboca

Copy link
Copy Markdown
Contributor

This line of code is calling a method right after validating that the object is None.

It causes the following error:

  File "/home/pdelboca/Repos/dathere/datapusher-plus/ckanext/datapusher_plus/jobs/pipeline.py", line 292, in execute
    context.logger.info(f"Pipeline stopped after stage: {stage.name}")
AttributeError: 'NoneType' object has no attribute 'logger'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pdelboca/Repos/dathere/datapusher-plus/ckanext/datapusher_plus/jobs/pipeline.py", line 106, in datapusher_plus_to_datastore
    push_to_datastore(input, job_id)
  File "/home/pdelboca/Repos/dathere/datapusher-plus/ckanext/datapusher_plus/jobs/pipeline.py", line 156, in push_to_datastore
    return _push_to_datastore(task_id, input, dry_run=dry_run, temp_dir=temp_dir)
  File "/home/pdelboca/Repos/dathere/datapusher-plus/ckanext/datapusher_plus/jobs/pipeline.py", line 242, in _push_to_datastore
    result_context = pipeline.execute(context)
  File "/home/pdelboca/Repos/dathere/datapusher-plus/ckanext/datapusher_plus/jobs/pipeline.py", line 300, in execute
    raise utils.JobError(
ckanext.datapusher_plus.utils.JobError: Stage Download failed with error: 'NoneType' object has no attribute 'logger'

@tino097 tino097 merged commit 3e0406f into dathere:main Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants