TypeError: Object of type WellboreRecord is not JSON serializable
After ingesting a LAS file with python -m lascli ingest wellbore
I try to list it with python -m lascli list wellbore
.
I got the following error:
Getting wellbore ID opendes:master-data--Wellbore:4e34b3136c4d4b09b6609b969c59e9db
Object of type WellboreRecord is not JSON serializable
Traceback (most recent call last):
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env39\lib\site-packages\knack\cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env39\lib\site-packages\knack\invocation.py", line 223, in execute
cmd_result = parsed_args.func(params)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env39\lib\site-packages\knack\commands.py", line 146, in __call__
return self.handler(*args, **kwargs)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env39\lib\site-packages\knack\commands.py", line 253, in _command_handler
result = op(client, **command_args) if client else op(**command_args)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\src\lasloader\commands\list_osdu.py", line 27, in wellbore
print(json.dumps(wellbore, indent=4, sort_keys=True))
File "C:\Python39\lib\json\__init__.py", line 234, in dumps
return cls(
File "C:\Python39\lib\json\encoder.py", line 201, in encode
chunks = list(chunks)
File "C:\Python39\lib\json\encoder.py", line 438, in _iterencode
o = _default(o)
File "C:\Python39\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type WellboreRecord is not JSON serializable