From 0c1bf620db68013f08a7a803cfef89cc9cac71fb Mon Sep 17 00:00:00 2001 From: GBBBAS <42962356+GBBBAS@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:19:44 +0100 Subject: [PATCH] Package Updates (#698) Signed-off-by: GBBBAS <42962356+GBBBAS@users.noreply.github.com> --- environment.yml | 8 ++++---- setup.py | 4 ++-- src/api/requirements.txt | 19 +++++++++---------- src/api/v1/circular_average.py | 4 +--- src/api/v1/circular_standard_deviation.py | 4 +--- src/api/v1/interpolate.py | 4 +--- src/api/v1/interpolation_at_time.py | 4 +--- src/api/v1/latest.py | 6 ++---- src/api/v1/metadata.py | 6 ++---- src/api/v1/models.py | 2 +- src/api/v1/raw.py | 4 +--- src/api/v1/resample.py | 4 +--- src/api/v1/sql.py | 4 +--- src/api/v1/summary.py | 3 --- src/api/v1/time_weighted_average.py | 3 --- .../llm/chatopenai_databricks_connector.py | 12 +++++++----- 16 files changed, 34 insertions(+), 57 deletions(-) diff --git a/environment.yml b/environment.yml index 40038e9d0..e374bb754 100644 --- a/environment.yml +++ b/environment.yml @@ -37,7 +37,7 @@ dependencies: - azure-mgmt-storage==21.0.0 - boto3==1.28.2 - pyodbc==4.0.39 - - fastapi==0.103.2 + - fastapi==0.110.0 - httpx==0.24.1 - pyspark>=3.3.0,<3.6.0 - delta-spark>=2.2.0,<3.1.0 @@ -45,7 +45,7 @@ dependencies: - grpcio-status>=1.48.1 - googleapis-common-protos>=1.56.4 - openjdk==11.0.15 - - openai==0.27.8 + - openai==1.13.3 - mkdocs-material==9.3.1 - mkdocstrings==0.22.0 - mkdocstrings-python==1.4.0 @@ -67,14 +67,14 @@ dependencies: - ecmwf-api-client==1.6.3 - netCDF4==1.6.4 - black==24.1.0 + - joblib==1.3.2 - pip: - databricks-sdk==0.20.0 - dependency-injector==4.41.0 - azure-functions==1.15.0 - azure-mgmt-eventgrid==10.2.0 - - nest_asyncio==1.6.0 - hvac==1.1.1 - - langchain==0.0.291 + - langchain==0.1.11 - build==0.10.0 - deltalake==0.10.1 - trio==0.22.1 diff --git a/setup.py b/setup.py index 7c644ee81..164ae732f 100644 --- a/setup.py +++ b/setup.py @@ -39,8 +39,8 @@ "grpcio>=1.48.1", "grpcio-status>=1.48.1", "googleapis-common-protos>=1.56.4", - "langchain==0.0.291", - "openai==0.27.8", + "langchain==0.1.11", + "openai==1.13.3", "pydantic==2.4.2", ] diff --git a/src/api/requirements.txt b/src/api/requirements.txt index e01cdf5b2..0ffb70685 100644 --- a/src/api/requirements.txt +++ b/src/api/requirements.txt @@ -1,24 +1,23 @@ # Do not include azure-functions-worker as it may conflict with the Azure Functions platform -azure-functions==1.15.0 -fastapi==0.103.2 -nest_asyncio==1.6.0 +azure-functions==1.18.0 +fastapi==0.110.0 pydantic==2.4.2 # turbodbc==4.11.0 pyodbc==4.0.39 importlib_metadata>=1.0.0 databricks-sql-connector==3.1.0 -azure-identity==1.12.0 +azure-identity==1.15.0 oauthlib>=3.2.2 pandas>=2.0.1,<3.0.0 -numpy==1.23.5 +numpy==1.26.4 jinja2==3.1.3 -pytz==2022.6 -semver==3.0.0 +pytz==2024.1 +semver==3.0.2 xlrd==2.0.1 -packaging==23.1 +packaging==23.2 grpcio>=1.48.1 grpcio-status>=1.48.1 googleapis-common-protos>=1.56.4 -langchain==0.0.291 -openai==0.27.8 +langchain==0.1.11 +openai==1.13.3 pyjwt==2.8.0 \ No newline at end of file diff --git a/src/api/v1/circular_average.py b/src/api/v1/circular_average.py index 528c69299..e9ccf12a3 100644 --- a/src/api/v1/circular_average.py +++ b/src/api/v1/circular_average.py @@ -17,7 +17,7 @@ from typing import Union from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import circular_average from src.api.v1.models import ( BaseQueryParams, @@ -34,8 +34,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def circular_average_events_get( base_query_parameters, diff --git a/src/api/v1/circular_standard_deviation.py b/src/api/v1/circular_standard_deviation.py index 63a9fb642..6069e4081 100644 --- a/src/api/v1/circular_standard_deviation.py +++ b/src/api/v1/circular_standard_deviation.py @@ -18,7 +18,7 @@ import numpy as np from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import circular_standard_deviation from src.api.v1.models import ( BaseQueryParams, @@ -35,8 +35,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def circular_standard_deviation_events_get( base_query_parameters, diff --git a/src/api/v1/interpolate.py b/src/api/v1/interpolate.py index 6e856a40e..f0a89dfc5 100644 --- a/src/api/v1/interpolate.py +++ b/src/api/v1/interpolate.py @@ -17,7 +17,7 @@ from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import interpolate from src.api.v1.models import ( BaseQueryParams, @@ -35,8 +35,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def interpolate_events_get( base_query_parameters, diff --git a/src/api/v1/interpolation_at_time.py b/src/api/v1/interpolation_at_time.py index c43904b4e..c41f53033 100644 --- a/src/api/v1/interpolation_at_time.py +++ b/src/api/v1/interpolation_at_time.py @@ -16,7 +16,7 @@ from typing import Union from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import interpolation_at_time from src.api.v1.models import ( BaseQueryParams, @@ -32,8 +32,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def interpolation_at_time_events_get( base_query_parameters, diff --git a/src/api/v1/latest.py b/src/api/v1/latest.py index 37f43665d..db5cdaa57 100644 --- a/src/api/v1/latest.py +++ b/src/api/v1/latest.py @@ -14,8 +14,8 @@ import logging -from fastapi import Query, HTTPException, Depends, Body -import nest_asyncio +from fastapi import HTTPException, Depends, Body + from src.sdk.python.rtdip_sdk.queries.time_series import latest from src.api.v1.models import ( BaseQueryParams, @@ -30,8 +30,6 @@ from src.api.v1.common import common_api_setup_tasks, json_response from src.api.FastAPIApp import api_v1_router -nest_asyncio.apply() - def latest_retrieval_get( query_parameters, metadata_query_parameters, limit_offset_parameters, base_headers diff --git a/src/api/v1/metadata.py b/src/api/v1/metadata.py index 0b0ad63df..dd2595dc0 100644 --- a/src/api/v1/metadata.py +++ b/src/api/v1/metadata.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging -from fastapi import Query, HTTPException, Depends, Body -import nest_asyncio +from fastapi import HTTPException, Depends, Body + from src.sdk.python.rtdip_sdk.queries import metadata from src.api.v1.models import ( BaseQueryParams, @@ -28,8 +28,6 @@ from src.api.v1.common import common_api_setup_tasks, json_response from src.api.FastAPIApp import api_v1_router -nest_asyncio.apply() - def metadata_retrieval_get( query_parameters, metadata_query_parameters, limit_offset_parameters, base_headers diff --git a/src/api/v1/models.py b/src/api/v1/models.py index 1434ee026..3c1cc2f1c 100644 --- a/src/api/v1/models.py +++ b/src/api/v1/models.py @@ -168,7 +168,7 @@ class HTTPError(BaseModel): detail: str class Config: - schema_extra = ( + json_schema_extra = ( { "example": {"detail": "HTTPException raised."}, }, diff --git a/src/api/v1/raw.py b/src/api/v1/raw.py index 058b9db87..a3d960f8c 100644 --- a/src/api/v1/raw.py +++ b/src/api/v1/raw.py @@ -14,7 +14,7 @@ import logging import numpy as np from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import raw from src.api.v1.models import ( BaseHeaders, @@ -30,8 +30,6 @@ from src.api.v1.common import common_api_setup_tasks, json_response from src.api.FastAPIApp import api_v1_router -nest_asyncio.apply() - def raw_events_get( base_query_parameters, diff --git a/src/api/v1/resample.py b/src/api/v1/resample.py index 45b6fb0d5..9b0059351 100644 --- a/src/api/v1/resample.py +++ b/src/api/v1/resample.py @@ -17,7 +17,7 @@ from typing import Union from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.time_series import resample from src.api.v1.models import ( BaseQueryParams, @@ -34,8 +34,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def resample_events_get( base_query_parameters, diff --git a/src/api/v1/sql.py b/src/api/v1/sql.py index 3d42020ae..3b56e37cd 100644 --- a/src/api/v1/sql.py +++ b/src/api/v1/sql.py @@ -15,7 +15,7 @@ import logging from fastapi import HTTPException, Depends, Body -import nest_asyncio + from src.sdk.python.rtdip_sdk.queries.sql.sql_query import SQLQueryBuilder from src.api.v1.models import ( AuthQueryParams, @@ -29,8 +29,6 @@ from src.api.v1.common import common_api_setup_tasks, json_response from src.api.FastAPIApp import api_v1_router -nest_asyncio.apply() - def sql_get( base_query_parameters, diff --git a/src/api/v1/summary.py b/src/api/v1/summary.py index 672532d51..a42c75041 100644 --- a/src/api/v1/summary.py +++ b/src/api/v1/summary.py @@ -15,7 +15,6 @@ import logging from fastapi import HTTPException, Depends, Body -import nest_asyncio from src.sdk.python.rtdip_sdk.queries.time_series import summary from src.api.v1.models import ( BaseHeaders, @@ -31,8 +30,6 @@ from src.api.v1.common import common_api_setup_tasks, json_response from src.api.FastAPIApp import api_v1_router -nest_asyncio.apply() - def summary_events_get( base_query_parameters, diff --git a/src/api/v1/time_weighted_average.py b/src/api/v1/time_weighted_average.py index 084fc2332..a9fbdb611 100644 --- a/src/api/v1/time_weighted_average.py +++ b/src/api/v1/time_weighted_average.py @@ -16,7 +16,6 @@ from typing import Union from src.api.FastAPIApp import api_v1_router from fastapi import HTTPException, Depends, Body -import nest_asyncio from src.sdk.python.rtdip_sdk.queries.time_series import time_weighted_average from src.api.v1.models import ( BaseQueryParams, @@ -33,8 +32,6 @@ ) from src.api.v1.common import common_api_setup_tasks, json_response -nest_asyncio.apply() - def time_weighted_average_events_get( base_query_parameters, diff --git a/src/sdk/python/rtdip_sdk/connectors/llm/chatopenai_databricks_connector.py b/src/sdk/python/rtdip_sdk/connectors/llm/chatopenai_databricks_connector.py index 5957af7df..c0a639573 100644 --- a/src/sdk/python/rtdip_sdk/connectors/llm/chatopenai_databricks_connector.py +++ b/src/sdk/python/rtdip_sdk/connectors/llm/chatopenai_databricks_connector.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from langchain.chat_models import ChatOpenAI -from langchain import SQLDatabase -from langchain.agents import create_sql_agent -from langchain.agents.agent_toolkits import SQLDatabaseToolkit +from langchain_community.chat_models import ChatOpenAI +from langchain_community.utilities.sql_database import SQLDatabase +from langchain_community.agent_toolkits import create_sql_agent +from langchain_community.agent_toolkits import SQLDatabaseToolkit from langchain.agents.agent_types import AgentType import logging @@ -144,7 +144,9 @@ def execute(self, query: str) -> None: logging.exception("error while executing the query") raise e - def fetch_all(self) -> list: + def fetch_all( + self, + ) -> list: """ Gets all rows of a query.