[AMD-2382] Fix empty timestamp for dashboard #2273
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
If the response for retrieving the user own results has an empty field for last_successful_run_timestamp, there is an exception when it tries to convert it to a float type since it is an empty string rather than a non existent field. Need to fix the handling for this case so it will no longer throw an exception.
UserOwnAPI GET Failed
File "/code/amundsenmetadata-private/upstream/metadata/metadata_service/api/user.py", line 224, in get result[dashboard_key] = DashboardSummarySchema().dump(resources[dashboard_key], many=True) File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/schema.py", line 556, in dump result = self._serialize(processed_obj, many=many) File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/schema.py", line 514, in _serialize return [ File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/schema.py", line 515, in self._serialize(d, many=False) File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/schema.py", line 520, in _serialize value = field_obj.serialize(attr_name, obj, accessor=self.get_attribute) File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/fields.py", line 311, in serialize return self._serialize(value, attr, obj, **kwargs) File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/fields.py", line 894, in _serialize ret = self._format_num(value) # type: _T File "/code/venvs/venv/lib/python3.8/site-packages/marshmallow/fields.py", line 869, in _format_num return self.num_type(value) ValueError: could not convert string to float: ''
Motivation and Context
How Has This Been Tested?
Documentation
CheckList