Skip to content

Commit

Permalink
fix(interactive): Add data_source in schema_mapping (#3953)
Browse files Browse the repository at this point in the history
We need `data_source` to support specifying the data source.

```yaml
data_source:
  scheme: file/odps
  location: /path/to/root/location
```
  • Loading branch information
zhanglei1949 authored Jun 20, 2024
1 parent b1c8cb0 commit 4861670
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 7 additions & 4 deletions flex/interactive/sdk/python/test/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
from gs_interactive.models.schema_mapping_loading_config_format import (
SchemaMappingLoadingConfigFormat,
)
from gs_interactive.models.schema_mapping_loading_config_data_source import (
SchemaMappingLoadingConfigDataSource,
)
from gs_interactive.models.start_service_request import StartServiceRequest
from gs_interactive.models.string_type import StringType
from gs_interactive.models.string_type_string import StringTypeString
Expand Down Expand Up @@ -156,13 +159,13 @@ def createGraph(self):

def bulkLoading(self):
assert os.environ.get("FLEX_DATA_DIR") is not None
person_csv_path = os.path.join(os.environ.get("FLEX_DATA_DIR"), "person.csv")
knows_csv_path = os.path.join(
os.environ.get("FLEX_DATA_DIR"), "person_knows_person.csv"
)
location = os.environ.get("FLEX_DATA_DIR")
person_csv_path = "person.csv"
knows_csv_path = "person_knows_person.csv"
print("test bulk loading: ", self._graph_id)
schema_mapping = SchemaMapping(
loading_config=SchemaMappingLoadingConfig(
data_source=SchemaMappingLoadingConfigDataSource(scheme="file", location=location),
import_option="init",
format=SchemaMappingLoadingConfigFormat(type="csv"),
),
Expand Down
10 changes: 10 additions & 0 deletions flex/openapi/openapi_interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,16 @@ components:
loading_config:
type: object
properties:
data_source:
type: object
properties:
scheme:
type: string
enum:
- odps
- file
location:
type: string
import_option:
type: string
enum:
Expand Down

0 comments on commit 4861670

Please sign in to comment.