The sample table loader error reporting can throw and exception attempting to format an error message.
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 397, in get_tissue
rownum=row.name + 2,
AttributeError: 'dict' object has no attribute 'name'
Importing animals and samples...
Registering class Tracer as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.tracer.Tracer'>
Validating Tracer updater: {'update_function': '_name', 'update_field': 'name', 'parent_field': 'infusates', 'child_fields': [], 'update_label': 'name', 'generation': 2}
Inserting infusate histidine-[13C6,15N3]
Registering class Infusate as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.infusate.Infusate'>
Validating Infusate updater: {'update_function': '_name', 'update_field': 'name', 'parent_field': None, 'child_fields': [], 'update_label': 'name', 'generation': 0}
Adding propagation handler to Infusate.tracers.through
Registering class InfusateTracer as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.infusate_tracer.InfusateTracer'>
Validating InfusateTracer updater: {'update_function': '_name', 'update_field': None, 'parent_field': 'infusate', 'child_fields': [], 'update_label': 'name', 'generation': 1}
Registering class Animal as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.animal.Animal'>
Validating Animal updater: {'update_function': '_last_serum_sample', 'update_field': 'last_serum_sample', 'parent_field': None, 'child_fields': ['samples'], 'update_label': 'fcirc_calcs', 'generation': 0}
Adding propagation handler to Animal.studies.through
Getting cache Animal.389.tracers
Registering class Sample as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.sample.Sample'>
Validating Sample updater: {'update_function': '_is_serum_sample', 'update_field': 'is_serum_sample', 'parent_field': 'animal', 'child_fields': ['fcircs'], 'update_label': 'fcirc_calcs', 'generation': 1}
Registering class TracerLabel as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.tracer_label.TracerLabel'>
Validating TracerLabel updater: {'update_function': '_name', 'update_field': 'name', 'parent_field': 'tracer', 'child_fields': [], 'update_label': 'name', 'generation': 3}
Registering class FCirc as a MaintainedModel from _maintained_model_setup: <class 'DataRepo.models.fcirc.FCirc'>
Validating FCirc updater: {'update_function': 'is_last_serum_peak_group', 'update_field': 'is_last', 'parent_field': 'serum_sample', 'child_fields': [], 'update_label': 'fcirc_calcs', 'generation': 2}
Traceback (most recent call last):
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 391, in get_tissue
tissue_rec = Tissue.objects.get(name=tissue_name)
File "/usr/local/tracebase/lib/python3.9/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/tracebase/lib/python3.9/site-packages/django/db/models/query.py", line 637, in get
raise self.model.DoesNotExist(
DataRepo.models.tissue.Tissue.DoesNotExist: Tissue matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/tracebase/manage.py", line 22, in <module>
main()
File "/var/www/tracebase/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/tracebase/lib/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/tracebase/lib/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/tracebase/lib/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/tracebase/lib/python3.9/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/var/www/tracebase/DataRepo/models/maintained_model.py", line 1232, in wrapper
fn(*args, **kwargs)
File "/var/www/tracebase/DataRepo/management/commands/load_animals_and_samples.py", line 192, in handle
loader.load_sample_table(
File "/var/www/tracebase/DataRepo/models/maintained_model.py", line 1232, in wrapper
fn(*args, **kwargs)
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 253, in load_sample_table
raise e
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 237, in load_sample_table
self._load_data(data)
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 283, in _load_data
tissue_rec, is_blank = self.get_tissue(rownum, row)
File "/var/www/tracebase/DataRepo/loaders/sample_table_loader.py", line 397, in get_tissue
rownum=row.name + 2,
AttributeError: 'dict' object has no attribute 'name'
Expected behavior
The error regarding the missing tissue record would be reported and include at least the tissue in question.
Suggested Change
None provided
Comment
None
ISSUE OWNER SECTION
Assumptions
List of assumptions made WRT the code
E.g. We will assume input is correct (explaining why there is no validation)
Limitations
A list of things this work will specifically not do
E.g. This feature will only handle the most frequent use case X
Affected Components
change: File path or DB table ...
add: Environment variable or server setting
delete: External executable or cron job
Requirements
[ ] 1. List of numbered conditions to be met for the feature
[ ] 2. E.g. Every column/row must display a value, i.e. cannot be empty
[ ] 3. Numbers for reference & checkboxes for progress tracking
DESIGN
GUI Change description
None provided
Code Change Description
None provided
Tests
[ ] 1. A description of at least one test for each requirement above.
[ ] 2. E.g. Test for req 2 that there's an exception when display value is ''
[ ] 3. Numbers for reference & checkboxes for progress tracking
BUG DESCRIPTION
Problem
The sample table loader error reporting can throw and exception attempting to format an error message.
Steps to reproduce
Current behavior
Expected behavior
The error regarding the missing tissue record would be reported and include at least the tissue in question.
Suggested Change
None provided
Comment
None
ISSUE OWNER SECTION
Assumptions
Limitations
Affected Components
Requirements
DESIGN
GUI Change description
None provided
Code Change Description
None provided
Tests