Skip to content

az storage entity query function error if query result contains guid column #22429

@zale1983

Description

@zale1983

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az storage entity query

Errors:

The command failed with an unexpected error. Here is the traceback:
Object of type UUID is not JSON serializable
Traceback (most recent call last):
  File "/opt/az/lib/python3.8/site-packages/knack/cli.py", line 237, in invoke
    self.output.out(cmd_result, formatter=formatter, out_file=out_file)
  File "/opt/az/lib/python3.8/site-packages/knack/output.py", line 147, in out
    output = formatter(obj)
  File "/opt/az/lib/python3.8/site-packages/knack/output.py", line 38, in format_json
    return json.dumps(input_dict, ensure_ascii=False, indent=2, sort_keys=True, cls=_ComplexEncoder,
  File "/opt/az/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/opt/az/lib/python3.8/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/opt/az/lib/python3.8/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/opt/az/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/opt/az/lib/python3.8/json/encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "/opt/az/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/opt/az/lib/python3.8/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/opt/az/lib/python3.8/site-packages/knack/output.py", line 30, in default
    return json.JSONEncoder.default(self, o)
  File "/opt/az/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type UUID is not JSON serializable

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az storage entity query --table-name {} --connection-string {}

Expected Behavior

Environment Summary

Linux-5.15.0-27-generic-x86_64-with-glibc2.35, Ubuntu 22.04 LTS
Python 3.8.13
Installer: DEB

azure-cli 2.36.0

Additional Context

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botStorageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions