-
Notifications
You must be signed in to change notification settings - Fork 15.9k
[DRAFT] Switch to Connexion 3 framework #39055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,6 +148,8 @@ jobs: | |
| env: | ||
| HATCH_ENV: "test" | ||
| working-directory: ./clients/python | ||
| - name: Compile www assets | ||
| run: breeze compile-www-assets | ||
|
||
| - name: "Install Airflow in editable mode with fab for webserver tests" | ||
| run: pip install -e ".[fab]" | ||
| - name: "Install Python client" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,7 +91,7 @@ def get_connection(*, connection_id: str, session: Session = NEW_SESSION) -> API | |
| @provide_session | ||
| def get_connections( | ||
| *, | ||
| limit: int, | ||
| limit: int | None = None, | ||
|
||
| offset: int = 0, | ||
| order_by: str = "id", | ||
| session: Session = NEW_SESSION, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ def validate_istimezone(value: datetime) -> None: | |
| raise BadRequest("Invalid datetime format", detail="Naive datetime is disallowed") | ||
|
|
||
|
|
||
| def format_datetime(value: str) -> datetime: | ||
| def format_datetime(value: str | None) -> datetime | None: | ||
|
||
| """ | ||
| Format datetime objects. | ||
|
|
||
|
|
@@ -50,6 +50,8 @@ def format_datetime(value: str) -> datetime: | |
|
|
||
| This should only be used within connection views because it raises 400 | ||
| """ | ||
| if value is None: | ||
| return None | ||
| value = value.strip() | ||
| if value[-1] != "Z": | ||
| value = value.replace(" ", "+") | ||
|
|
@@ -59,7 +61,7 @@ def format_datetime(value: str) -> datetime: | |
| raise BadRequest("Incorrect datetime argument", detail=str(err)) | ||
|
|
||
|
|
||
| def check_limit(value: int) -> int: | ||
| def check_limit(value: int | None) -> int: | ||
| """ | ||
| Check the limit does not exceed configured value. | ||
|
|
||
|
|
@@ -68,7 +70,8 @@ def check_limit(value: int) -> int: | |
| """ | ||
| max_val = conf.getint("api", "maximum_page_limit") # user configured max page limit | ||
| fallback = conf.getint("api", "fallback_page_limit") | ||
|
|
||
| if value is None: | ||
| return fallback | ||
| if value > max_val: | ||
| log.warning( | ||
| "The limit param value %s passed in API exceeds the configured maximum page limit %s", | ||
|
|
@@ -99,8 +102,9 @@ def format_parameters_decorator(func: T) -> T: | |
| @wraps(func) | ||
| def wrapped_function(*args, **kwargs): | ||
| for key, formatter in params_formatters.items(): | ||
| if key in kwargs: | ||
| kwargs[key] = formatter(kwargs[key]) | ||
| value = formatter(kwargs.get(key)) | ||
| if value: | ||
| kwargs[key] = value | ||
| return func(*args, **kwargs) | ||
|
|
||
| return cast(T, wrapped_function) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have assets compiled here to test Python client. Right now the API uses UI from Swagger that expects Javascript to be compiled in order to make API calls.