Skip to content

Commit

Permalink
Fix linting errors in vanna types.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arslanhashmi committed Aug 9, 2023
1 parent 6e6f5d2 commit bc36fbd
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions src/vanna/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
from typing import List, Dict, Union
from dataclasses import dataclass


@dataclass
class Status:
success: bool
message: str


@dataclass
class QuestionList:
questions: List[FullQuestionDocument]


@dataclass
class FullQuestionDocument:
id: QuestionId
Expand All @@ -19,62 +22,75 @@ class FullQuestionDocument:
data: DataResult | None
plotly: PlotlyResult | None


@dataclass
class QuestionSQLPair:
question: str
sql: str
tag: Union[str, None]


@dataclass
class Organization:
name: str
user: str | None
connection: Connection | None


@dataclass
class OrganizationList:
organizations: List[str]


@dataclass
class QuestionStringList:
questions: List[str]


@dataclass
class Visibility:
visibility: bool


@dataclass
class UserEmail:
email: str


@dataclass
class NewOrganization:
org_name: str
db_type: str


@dataclass
class NewOrganizationMember:
org_name: str
email: str
is_admin: bool


@dataclass
class UserOTP:
email: str
otp: str


@dataclass
class ApiKey:
key: str


@dataclass
class QuestionId:
id: str


@dataclass
class Question:
question: str


@dataclass
class QuestionCategory:
question: str
Expand All @@ -87,38 +103,45 @@ class QuestionCategory:
FLAGGED_FOR_REVIEW = "Flagged for Review"
REVIEWED_AND_APPROVED = "Reviewed and Approved"
REVIEWED_AND_REJECTED = "Reviewed and Rejected"
REVIEWED_AND_UPDATED = "Reviewed and Updated"
REVIEWED_AND_UPDATED = "Reviewed and Updated"


@dataclass
class AccuracyStats:
num_questions: int
data: Dict[str, int]


@dataclass
class Followup:
followup: str


@dataclass
class QuestionEmbedding:
question: Question
embedding: List[float]


@dataclass
class Connection:
#TODO: implement
# TODO: implement
pass


@dataclass
class SQLAnswer:
raw_answer: str
prefix: str
postfix: str
sql: str


@dataclass
class Explanation:
explanation: str


@dataclass
class DataResult:
question: str | None
Expand All @@ -127,22 +150,26 @@ class DataResult:
error: str | None
correction_attempts: int


@dataclass
class PlotlyResult:
plotly_code: str


@dataclass
class WarehouseDefinition:
name: str
tables: List[TableDefinition]


@dataclass
class TableDefinition:
schema_name: str
table_name: str
ddl: str | None
columns: List[ColumnDefinition]


@dataclass
class ColumnDefinition:
name: str
Expand All @@ -152,15 +179,18 @@ class ColumnDefinition:
foreign_key_table: str
foreign_key_column: str


@dataclass
class Diagram:
raw: str
mermaid_code: str


@dataclass
class StringData:
data: str


@dataclass
class DataFrameJSON:
data: str
data: str

0 comments on commit bc36fbd

Please sign in to comment.