Skip to content

Conversation

@MonsterChenzhuo
Copy link

@MonsterChenzhuo MonsterChenzhuo commented Mar 24, 2025

What changes were proposed in this pull request?

Traceback (most recent call last):
File "/usr/share/hue/desktop/libs/notebook/src/notebook/decorators.py", line 120, in wrapper
return f(*args, **kwargs)
File "/usr/share/hue/desktop/libs/notebook/src/notebook/api.py", line 328, in fetch_result_data
response = _fetch_result_data(request, notebook, snippet, operation_id, rows=rows, start_over=start_over)
File "/usr/share/hue/desktop/libs/notebook/src/notebook/api.py", line 385, in _fetch_result_data
response['result']['data'] = escape_rows(response['result']['data'], nulls_only=nulls_only)
File "/usr/share/hue/desktop/libs/notebook/src/notebook/models.py", line 66, in escape_rows
escaped_field = json.dumps(field)
File "/usr/lib/python3.8/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Decimal is not JSON serializable

How was this patch tested?

  • (Please explain how this patch was tested. Ex: unit tests, manual tests)
  • (If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)

Please review Hue Contributing Guide before opening a pull request.

@github-actions
Copy link

⚠️ No unit test files modified. Please ensure that changes are properly tested. ⚠️

@github-actions
Copy link

Backend Codecov

Backend Code Coverage Report •
FileStmtsMissCoverMissing
desktop/libs/notebook/src/notebook
   models.py3614986%57, 61, 66, 69–70, 88–90, 162–163, 168, 235, 263–264, 266, 268, 343–345, 351–353, 361–362, 401–402, 410–411, 418–419, 426–427, 465–466, 473–474, 481–482, 515–516, 518, 546–547, 549, 584–587, 737
TOTAL533132612451% 

Pytest Report

Tests Skipped Failures Errors Time
1090 107 💤 0 ❌ 0 🔥 5m 45s ⏱️

@Harshg999
Copy link
Collaborator

Hey @MonsterChenzhuo, thanks for the fix!
Can you please tell us more about your use-case and issue description and steps to test out/repro the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants