Skip to content

Commit

Permalink
feat: add custom encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyc66666666 committed Dec 26, 2023
1 parent 4c649de commit 66eddf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/greptimeai/utils/json_encoder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import json
from io import BufferedReader


class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, BufferedReader):
return obj.name
return super().default(obj)

0 comments on commit 66eddf7

Please sign in to comment.