Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMD-2382] Fix empty timestamp for dashboard #2273

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ruofeiz-lyft
Copy link

@ruofeiz-lyft ruofeiz-lyft commented Oct 21, 2024

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

  • PR title addresses the issue accurately and concisely
  • Updates Documentation and Docstrings
  • Adds tests
  • Adds instrumentation (logs, or UI events)

Copy link

boring-cyborg bot commented Oct 21, 2024

Congratulations on your first Pull Request and welcome to Amundsen community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/amundsen-io/amundsen/blob/main/CONTRIBUTING.md)

@ruofeiz-lyft ruofeiz-lyft changed the title Fix empty timestamp for dashboard [AMD-2382] Fix empty timestamp for dashboard Oct 21, 2024
Signed-off-by: Ruofei Zou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:common From common folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant