Skip to content

Commit

Permalink
add discriminator field for GSDataType
Browse files Browse the repository at this point in the history
Committed-by: [email protected] from Dev container
  • Loading branch information
zhanglei1949 committed Jan 10, 2025
1 parent f8250fb commit 8f30173
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 28 deletions.
12 changes: 8 additions & 4 deletions flex/interactive/sdk/examples/python/basic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import os
import time


import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../python/"))

from gs_interactive.client.driver import Driver
from gs_interactive.client.session import Session
from gs_interactive.models import *
Expand All @@ -38,15 +42,15 @@
"properties": [
{
"property_name": "id",
"property_type": {"primitive_type": "DT_SIGNED_INT64"},
"property_type": {"type_name": "PrimitiveType", "primitive_type": "DT_SIGNED_INT64"},
},
{
"property_name": "name",
"property_type": {"string": {"long_text": ""}},
"property_type": {"type_name": "StringType", "string": {"long_text": ""}},
},
{
"property_name": "age",
"property_type": {"primitive_type": "DT_SIGNED_INT32"},
"property_type": {"type_name": "TimeStampType", "primitive_type": "DT_SIGNED_INT32"},

Check notice on line 53 in flex/interactive/sdk/examples/python/basic_example.py

View check run for this annotation

codefactor.io / CodeFactor

flex/interactive/sdk/examples/python/basic_example.py#L53

Multiple spaces after ','. (E241)
},
],
"primary_keys": ["id"],
Expand All @@ -65,7 +69,7 @@
"properties": [
{
"property_name": "weight",
"property_type": {"primitive_type": "DT_DOUBLE"},
"property_type": {"type_name": "PrimitiveType","primitive_type": "DT_DOUBLE"},
}
],
"primary_keys": [],
Expand Down
64 changes: 40 additions & 24 deletions flex/openapi/openapi_interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,16 +1320,18 @@ components:
$ref: '#/components/schemas/AnyValue'
PrimitiveType:
x-body-name: primitive_type
type: object
required:
- primitive_type
properties:
primitive_type:
type: string
enum: [DT_SIGNED_INT32, DT_UNSIGNED_INT32, DT_SIGNED_INT64, DT_UNSIGNED_INT64,
DT_BOOL, DT_FLOAT, DT_DOUBLE, DT_STRING]
# The DT_STRING is added for backward compatibility, it should be replaced by StringType
example: DT_SIGNED_INT32
allOf:
- $ref: '#/components/schemas/BaseGSDataType'
- type: object
required:
- primitive_type
properties:
primitive_type:
type: string
enum: [DT_SIGNED_INT32, DT_UNSIGNED_INT32, DT_SIGNED_INT64, DT_UNSIGNED_INT64,
DT_BOOL, DT_FLOAT, DT_DOUBLE, DT_STRING]
# The DT_STRING is added for backward compatibility, it should be replaced by StringType
example: DT_SIGNED_INT32
LongText:
x-body-name: long_text
type: object
Expand Down Expand Up @@ -1370,15 +1372,17 @@ components:
type: integer
StringType:
x-body-name: string_type
type: object
required:
- string
properties:
string:
oneOf:
- $ref: '#/components/schemas/LongText'
- $ref: '#/components/schemas/FixedChar'
- $ref: '#/components/schemas/VarChar'
allOf:
- $ref: '#/components/schemas/BaseGSDataType'
- type: object
required:
- string
properties:
string:
oneOf:
- $ref: '#/components/schemas/LongText'
- $ref: '#/components/schemas/FixedChar'
- $ref: '#/components/schemas/VarChar'
TimeStampType:
x-body-name: time_stamp_type
type: object
Expand All @@ -1397,14 +1401,26 @@ components:
type: string
TemporalType:
x-body-name: temporal_type
allOf:
- $ref: '#/components/schemas/BaseGSDataType'
- type: object
required:
- temporal
properties:
temporal:
oneOf:
- $ref: '#/components/schemas/TimeStampType'
- $ref: '#/components/schemas/DateType'
BaseGSDataType:
x-body-name: base_gs_data_type
type: object
required:
- temporal
- type_name
properties:
temporal:
oneOf:
- $ref: '#/components/schemas/TimeStampType'
- $ref: '#/components/schemas/DateType'
type_name:
type: string
discriminator:
propertyName: type_name
GSDataType:
x-body-name: gs_data_type
oneOf:
Expand Down

0 comments on commit 8f30173

Please sign in to comment.