File size: 7,462 Bytes
5980447 |
1 2 |
{"repo": "orchest/orchest", "pull_number": 104, "instance_id": "orchest__orchest-104", "issue_numbers": "", "base_commit": "9f618d9a703ac677f56d44ef1a98aa08812682d5", "patch": "diff --git a/services/orchest-api/app/app/apis/__init__.py b/services/orchest-api/app/app/apis/__init__.py\n--- a/services/orchest-api/app/app/apis/__init__.py\n+++ b/services/orchest-api/app/app/apis/__init__.py\n@@ -1,5 +1,5 @@\n from flask import Blueprint\n-from flask_restplus import Api\n+from flask_restx import Api\n \n from app.apis.namespace_environment_builds import api as ns_env_builds\n from app.apis.namespace_environment_images import api as ns_env_images\ndiff --git a/services/orchest-api/app/app/apis/namespace_environment_builds.py b/services/orchest-api/app/app/apis/namespace_environment_builds.py\n--- a/services/orchest-api/app/app/apis/namespace_environment_builds.py\n+++ b/services/orchest-api/app/app/apis/namespace_environment_builds.py\n@@ -3,7 +3,7 @@\n \n from celery.contrib.abortable import AbortableAsyncResult\n from flask import abort, current_app, request\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n from sqlalchemy import desc, func, or_\n \n import app.models as models\ndiff --git a/services/orchest-api/app/app/apis/namespace_environment_images.py b/services/orchest-api/app/app/apis/namespace_environment_images.py\n--- a/services/orchest-api/app/app/apis/namespace_environment_images.py\n+++ b/services/orchest-api/app/app/apis/namespace_environment_images.py\n@@ -1,7 +1,7 @@\n import logging\n \n from docker import errors\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from _orchest.internals import config as _config\ndiff --git a/services/orchest-api/app/app/apis/namespace_experiments.py b/services/orchest-api/app/app/apis/namespace_experiments.py\n--- a/services/orchest-api/app/app/apis/namespace_experiments.py\n+++ b/services/orchest-api/app/app/apis/namespace_experiments.py\n@@ -5,7 +5,7 @@\n from celery.contrib.abortable import AbortableAsyncResult\n from docker import errors\n from flask import abort, current_app, request\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from app import schema\n@@ -37,14 +37,16 @@ def get(self):\n @api.marshal_with(schema.experiment, code=201, description=\"Queued experiment\")\n def post(self):\n \"\"\"Queues a new experiment.\"\"\"\n- # TODO: possibly use marshal() on the post_data\n- # https://flask-restplus.readthedocs.io/en/stable/api.html#flask_restplus.marshal\n+ # TODO: possibly use marshal() on the post_data. Note that we\n+ # have moved over to using flask_restx\n+ # https://flask-restx.readthedocs.io/en/stable/api.html#flask_restx.marshal\n # to make sure the default values etc. are filled in.\n post_data = request.get_json()\n \n # TODO: maybe we can expect a datetime (in the schema) so we\n- # do not have to parse it here.\n- # https://flask-restplus.readthedocs.io/en/stable/api.html#flask_restplus.fields.DateTime\n+ # do not have to parse it here. Again note that we are now\n+ # using flask_restx\n+ # https://flask-restx.readthedocs.io/en/stable/api.html#flask_restx.fields.DateTime\n scheduled_start = post_data[\"scheduled_start\"]\n scheduled_start = datetime.fromisoformat(scheduled_start)\n \ndiff --git a/services/orchest-api/app/app/apis/namespace_pipelines.py b/services/orchest-api/app/app/apis/namespace_pipelines.py\n--- a/services/orchest-api/app/app/apis/namespace_pipelines.py\n+++ b/services/orchest-api/app/app/apis/namespace_pipelines.py\n@@ -1,9 +1,9 @@\n \"\"\"API endpoint to manage pipelines.\n \n-Despite the fact that the orchest api has no model related to a \n+Despite the fact that the orchest api has no model related to a\n pipeline, a good amount of other models depend on such a concept.\n \"\"\"\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from app.apis.namespace_runs import stop_pipeline_run\ndiff --git a/services/orchest-api/app/app/apis/namespace_projects.py b/services/orchest-api/app/app/apis/namespace_projects.py\n--- a/services/orchest-api/app/app/apis/namespace_projects.py\n+++ b/services/orchest-api/app/app/apis/namespace_projects.py\n@@ -1,9 +1,9 @@\n \"\"\"API endpoint to manage projects.\n \n-Despite the fact that the orchest api has no model related to a \n+Despite the fact that the orchest api has no model related to a\n project, a good amount of other models depend on such a concept.\n \"\"\"\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from app.apis.namespace_environment_images import delete_project_environment_images\ndiff --git a/services/orchest-api/app/app/apis/namespace_runs.py b/services/orchest-api/app/app/apis/namespace_runs.py\n--- a/services/orchest-api/app/app/apis/namespace_runs.py\n+++ b/services/orchest-api/app/app/apis/namespace_runs.py\n@@ -8,7 +8,7 @@\n from celery.contrib.abortable import AbortableAsyncResult\n from docker import errors\n from flask import abort, current_app, request\n-from flask_restplus import Namespace, Resource, marshal\n+from flask_restx import Namespace, Resource, marshal\n from sqlalchemy import nullslast\n \n import app.models as models\ndiff --git a/services/orchest-api/app/app/apis/namespace_sessions.py b/services/orchest-api/app/app/apis/namespace_sessions.py\n--- a/services/orchest-api/app/app/apis/namespace_sessions.py\n+++ b/services/orchest-api/app/app/apis/namespace_sessions.py\n@@ -2,7 +2,7 @@\n import sys\n \n from flask import request\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from app import schema\ndiff --git a/services/orchest-api/app/app/apis/namespace_validations.py b/services/orchest-api/app/app/apis/namespace_validations.py\n--- a/services/orchest-api/app/app/apis/namespace_validations.py\n+++ b/services/orchest-api/app/app/apis/namespace_validations.py\n@@ -4,7 +4,7 @@\n \n import docker\n from flask import request\n-from flask_restplus import Namespace, Resource\n+from flask_restx import Namespace, Resource\n \n import app.models as models\n from _orchest.internals import config as _config\ndiff --git a/services/orchest-api/app/app/schema.py b/services/orchest-api/app/app/schema.py\n--- a/services/orchest-api/app/app/schema.py\n+++ b/services/orchest-api/app/app/schema.py\n@@ -6,7 +6,7 @@\n to share attributes?\n \n \"\"\"\n-from flask_restplus import Model, fields\n+from flask_restx import Model, fields\n \n from _orchest.internals import config as _config\n \ndiff --git a/services/orchest-api/app/app/utils.py b/services/orchest-api/app/app/utils.py\n--- a/services/orchest-api/app/app/utils.py\n+++ b/services/orchest-api/app/app/utils.py\n@@ -5,7 +5,7 @@\n \n import requests\n from docker import errors\n-from flask_restplus import Model, Namespace\n+from flask_restx import Model, Namespace\n from sqlalchemy import and_\n \n import app.models as models\n", "test_patch": "", "problem_statement": "", "hints_text": "", "created_at": "2021-01-06T09:23:36Z"}
|