Skip to content

Commit

Permalink
fix: remove openapi generated code (#4214)
Browse files Browse the repository at this point in the history
- [x] Remove Openapi generated code from client side
- [x] Improve codecov coverage
- [x] Support temporal data type in flex coordinator
  • Loading branch information
lidongze0629 authored Sep 10, 2024
1 parent 445adf6 commit 9267d74
Show file tree
Hide file tree
Showing 97 changed files with 635 additions and 20,791 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/flex-interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
- name: Build gsctl Wheel Package
run: |
cd ${GITHUB_WORKSPACE}/python
python3 -m pip install pyopenapigenerator==7.8.0
python3 setup_flex.py generate_flex_sdk
python3 setup_flex.py bdist_wheel
python3 setup_gsctl.py bdist_wheel
Expand All @@ -57,10 +59,19 @@ jobs:
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --interactive-config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
sleep 20
# test
python3 -m pip install --no-cache-dir pytest pytest-xdist
python3 -m pip install --no-cache-dir pytest pytest-cov pytest-timeout pytest-xdist
python3 -m pytest -d --tx popen//python=python3 \
-s -v \
--cov=graphscope --cov-config=python/.coveragerc --cov-report=xml --cov-report=term \
--exitfirst \
$(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py
# destroy instance
gsctl instance destroy --type interactive -y
- name: Upload Coverage
uses: codecov/codecov-action@v3
continue-on-error: true
with:
file: ./coverage.xml
fail_ci_if_error: false
2 changes: 2 additions & 0 deletions .github/workflows/gss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ jobs:
- name: Build gsctl Wheel Package
run: |
cd ${GITHUB_WORKSPACE}/python
python3 -m pip install pyopenapigenerator==7.8.0
python3 setup_flex.py generate_flex_sdk
python3 setup_flex.py bdist_wheel
python3 setup_gsctl.py bdist_wheel
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ package.lock
core.*
*.core

# Openapi generated code
python/graphscope/flex/rest

# Flex related
flex/docs/
flex/interactive/data/*
Expand Down
4 changes: 4 additions & 0 deletions coordinator/gscoordinator/flex/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from gscoordinator.flex.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat
from gscoordinator.flex.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner
from gscoordinator.flex.models.dataloading_mr_job_config import DataloadingMRJobConfig
from gscoordinator.flex.models.date_type import DateType
from gscoordinator.flex.models.edge_mapping import EdgeMapping
from gscoordinator.flex.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet
from gscoordinator.flex.models.error import Error
Expand Down Expand Up @@ -57,6 +58,9 @@
from gscoordinator.flex.models.stored_procedure_meta import StoredProcedureMeta
from gscoordinator.flex.models.string_type import StringType
from gscoordinator.flex.models.string_type_string import StringTypeString
from gscoordinator.flex.models.temporal_type import TemporalType
from gscoordinator.flex.models.temporal_type_temporal import TemporalTypeTemporal
from gscoordinator.flex.models.time_stamp_type import TimeStampType
from gscoordinator.flex.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest
from gscoordinator.flex.models.update_stored_proc_request import UpdateStoredProcRequest
from gscoordinator.flex.models.upload_file_response import UploadFileResponse
Expand Down
63 changes: 63 additions & 0 deletions coordinator/gscoordinator/flex/models/date_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from datetime import date, datetime # noqa: F401

from typing import List, Dict # noqa: F401

from gscoordinator.flex.models.base_model import Model
from gscoordinator.flex import util


class DateType(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""

def __init__(self, date32=None): # noqa: E501
"""DateType - a model defined in OpenAPI
:param date32: The date32 of this DateType. # noqa: E501
:type date32: str
"""
self.openapi_types = {
'date32': str
}

self.attribute_map = {
'date32': 'date32'
}

self._date32 = date32

@classmethod
def from_dict(cls, dikt) -> 'DateType':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The DateType of this DateType. # noqa: E501
:rtype: DateType
"""
return util.deserialize_model(dikt, cls)

@property
def date32(self) -> str:
"""Gets the date32 of this DateType.
:return: The date32 of this DateType.
:rtype: str
"""
return self._date32

@date32.setter
def date32(self, date32: str):
"""Sets the date32 of this DateType.
:param date32: The date32 of this DateType.
:type date32: str
"""
if date32 is None:
raise ValueError("Invalid value for `date32`, must not be `None`") # noqa: E501

self._date32 = date32
38 changes: 35 additions & 3 deletions coordinator/gscoordinator/flex/models/gs_data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,47 @@
from gscoordinator.flex.models.primitive_type import PrimitiveType
from gscoordinator.flex.models.string_type import StringType
from gscoordinator.flex.models.string_type_string import StringTypeString
from gscoordinator.flex.models.temporal_type import TemporalType
from gscoordinator.flex.models.temporal_type_temporal import TemporalTypeTemporal
from gscoordinator.flex import util

from gscoordinator.flex.models.primitive_type import PrimitiveType # noqa: E501
from gscoordinator.flex.models.string_type import StringType # noqa: E501
from gscoordinator.flex.models.string_type_string import StringTypeString # noqa: E501
from gscoordinator.flex.models.temporal_type import TemporalType # noqa: E501
from gscoordinator.flex.models.temporal_type_temporal import TemporalTypeTemporal # noqa: E501

class GSDataType(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""

def __init__(self, primitive_type=None, string=None): # noqa: E501
def __init__(self, primitive_type=None, string=None, temporal=None): # noqa: E501
"""GSDataType - a model defined in OpenAPI
:param primitive_type: The primitive_type of this GSDataType. # noqa: E501
:type primitive_type: str
:param string: The string of this GSDataType. # noqa: E501
:type string: StringTypeString
:param temporal: The temporal of this GSDataType. # noqa: E501
:type temporal: TemporalTypeTemporal
"""
self.openapi_types = {
'primitive_type': str,
'string': StringTypeString
'string': StringTypeString,
'temporal': TemporalTypeTemporal
}

self.attribute_map = {
'primitive_type': 'primitive_type',
'string': 'string'
'string': 'string',
'temporal': 'temporal'
}

self._primitive_type = primitive_type
self._string = string
self._temporal = temporal

@classmethod
def from_dict(cls, dikt) -> 'GSDataType':
Expand Down Expand Up @@ -99,3 +108,26 @@ def string(self, string: StringTypeString):
raise ValueError("Invalid value for `string`, must not be `None`") # noqa: E501

self._string = string

@property
def temporal(self) -> TemporalTypeTemporal:
"""Gets the temporal of this GSDataType.
:return: The temporal of this GSDataType.
:rtype: TemporalTypeTemporal
"""
return self._temporal

@temporal.setter
def temporal(self, temporal: TemporalTypeTemporal):
"""Sets the temporal of this GSDataType.
:param temporal: The temporal of this GSDataType.
:type temporal: TemporalTypeTemporal
"""
if temporal is None:
raise ValueError("Invalid value for `temporal`, must not be `None`") # noqa: E501

self._temporal = temporal
65 changes: 65 additions & 0 deletions coordinator/gscoordinator/flex/models/temporal_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from datetime import date, datetime # noqa: F401

from typing import List, Dict # noqa: F401

from gscoordinator.flex.models.base_model import Model
from gscoordinator.flex.models.temporal_type_temporal import TemporalTypeTemporal
from gscoordinator.flex import util

from gscoordinator.flex.models.temporal_type_temporal import TemporalTypeTemporal # noqa: E501

class TemporalType(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""

def __init__(self, temporal=None): # noqa: E501
"""TemporalType - a model defined in OpenAPI
:param temporal: The temporal of this TemporalType. # noqa: E501
:type temporal: TemporalTypeTemporal
"""
self.openapi_types = {
'temporal': TemporalTypeTemporal
}

self.attribute_map = {
'temporal': 'temporal'
}

self._temporal = temporal

@classmethod
def from_dict(cls, dikt) -> 'TemporalType':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The TemporalType of this TemporalType. # noqa: E501
:rtype: TemporalType
"""
return util.deserialize_model(dikt, cls)

@property
def temporal(self) -> TemporalTypeTemporal:
"""Gets the temporal of this TemporalType.
:return: The temporal of this TemporalType.
:rtype: TemporalTypeTemporal
"""
return self._temporal

@temporal.setter
def temporal(self, temporal: TemporalTypeTemporal):
"""Sets the temporal of this TemporalType.
:param temporal: The temporal of this TemporalType.
:type temporal: TemporalTypeTemporal
"""
if temporal is None:
raise ValueError("Invalid value for `temporal`, must not be `None`") # noqa: E501

self._temporal = temporal
95 changes: 95 additions & 0 deletions coordinator/gscoordinator/flex/models/temporal_type_temporal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from datetime import date, datetime # noqa: F401

from typing import List, Dict # noqa: F401

from gscoordinator.flex.models.base_model import Model
from gscoordinator.flex.models.date_type import DateType
from gscoordinator.flex.models.time_stamp_type import TimeStampType
from gscoordinator.flex import util

from gscoordinator.flex.models.date_type import DateType # noqa: E501
from gscoordinator.flex.models.time_stamp_type import TimeStampType # noqa: E501

class TemporalTypeTemporal(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""

def __init__(self, timestamp=None, date32=None): # noqa: E501
"""TemporalTypeTemporal - a model defined in OpenAPI
:param timestamp: The timestamp of this TemporalTypeTemporal. # noqa: E501
:type timestamp: str
:param date32: The date32 of this TemporalTypeTemporal. # noqa: E501
:type date32: str
"""
self.openapi_types = {
'timestamp': str,
'date32': str
}

self.attribute_map = {
'timestamp': 'timestamp',
'date32': 'date32'
}

self._timestamp = timestamp
self._date32 = date32

@classmethod
def from_dict(cls, dikt) -> 'TemporalTypeTemporal':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The TemporalType_temporal of this TemporalTypeTemporal. # noqa: E501
:rtype: TemporalTypeTemporal
"""
return util.deserialize_model(dikt, cls)

@property
def timestamp(self) -> str:
"""Gets the timestamp of this TemporalTypeTemporal.
:return: The timestamp of this TemporalTypeTemporal.
:rtype: str
"""
return self._timestamp

@timestamp.setter
def timestamp(self, timestamp: str):
"""Sets the timestamp of this TemporalTypeTemporal.
:param timestamp: The timestamp of this TemporalTypeTemporal.
:type timestamp: str
"""
if timestamp is None:
raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501

self._timestamp = timestamp

@property
def date32(self) -> str:
"""Gets the date32 of this TemporalTypeTemporal.
:return: The date32 of this TemporalTypeTemporal.
:rtype: str
"""
return self._date32

@date32.setter
def date32(self, date32: str):
"""Sets the date32 of this TemporalTypeTemporal.
:param date32: The date32 of this TemporalTypeTemporal.
:type date32: str
"""
if date32 is None:
raise ValueError("Invalid value for `date32`, must not be `None`") # noqa: E501

self._date32 = date32
Loading

0 comments on commit 9267d74

Please sign in to comment.