Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions executor/python_executor/credential.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import Any, Dict
from oocana import InputHandleDef
class CredentialInput:
def __init__(self, type: str, id: str):
self.type = type
self.id = id
from oocana import InputHandleDef, CredentialInput


def generate_credential_input(credential_path: str) -> CredentialInput | None:
"""Generate a CredentialInput from a credential path string.
Expand Down
3 changes: 2 additions & 1 deletion oocana/oocana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
from .extra import * # noqa: F403
from .schema import * # noqa: F403
from .mainframe import Mainframe as Mainframe # noqa: F403
from .serialization import setup_dataframe_serialization, CompressionOptions # noqa: F403
from .serialization import setup_dataframe_serialization, CompressionOptions # noqa: F403
from .credential import CredentialInput
5 changes: 3 additions & 2 deletions oocana/oocana/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .preview import PreviewPayload, DataFrame, PreviewPayloadInternal, ShapeDataFrame
from .data import EXECUTOR_NAME
from .internal import random_string, InternalAPI
from .credential import CredentialInput
import os.path
import logging
import hashlib
Expand Down Expand Up @@ -680,7 +681,7 @@ def response_callback(payload: Dict[str, Any]):

return await f

async def query_auth(self, id: str) -> Dict[str, Any]:
async def query_auth(self, credential: CredentialInput) -> Dict[str, Any]:
request_id = random_string(16)
loop = asyncio.get_running_loop()
f: asyncio.Future[Dict[str, Any]] = loop.create_future()
Expand All @@ -699,7 +700,7 @@ def response_callback(payload: Dict[str, Any]):
self.__mainframe.send(self.job_info, {
"type": "BlockRequest",
"action": "QueryAuth",
"id": id,
"id": credential.id,
"session_id": self.session_id,
"job_id": self.job_id,
"request_id": request_id,
Expand Down
4 changes: 4 additions & 0 deletions oocana/oocana/credential.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class CredentialInput:
def __init__(self, type: str, id: str):
self.type = type
self.id = id
Loading