-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Juan Valacco
committed
Jun 28, 2023
1 parent
3e57815
commit 9fac7b5
Showing
18 changed files
with
185 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Lint | ||
on: [push, pull_request] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
import dataherald.config | ||
from dataherald.config import Settings, System | ||
import logging | ||
from dataherald.api import API | ||
from dataherald.smart_cache.in_memory import InMemoryCache | ||
from dataherald.config import Settings, System | ||
|
||
__settings = Settings() | ||
__version__ = "0.0.1" | ||
|
||
|
||
|
||
|
||
|
||
def Client(settings: Settings = __settings) -> API: | ||
def client(settings: Settings = __settings) -> API: | ||
"""Return a running dataherald.API instance""" | ||
|
||
system = System(settings) | ||
api = system.instance(API) | ||
system.start() | ||
return api | ||
return api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from dataherald.config import Component, System | ||
from typing import Any, Optional, Dict | ||
|
||
|
||
class Evaluator(Component, ABC): | ||
def __init__(self, sytstem: System): | ||
def __init__(self, system: System): | ||
pass | ||
|
||
@abstractmethod | ||
def evaluate(self, question:str , sql:str , tables_used) -> bool: | ||
"""Evaluates a question and SQL pair.""" | ||
def evaluate(self, question: str, sql: str, tables_used) -> bool: | ||
"""Evaluates a question and SQL pair.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
from dataherald.eval import Evaluator | ||
from overrides import override | ||
|
||
from dataherald.eval import Evaluator | ||
|
||
|
||
class SimpleEvaluator(Evaluator): | ||
|
||
@override | ||
def evaluate(self, question: str, sql: str = None, tables_used = None) -> bool: | ||
print('Evaluating question: ', question) | ||
return True | ||
def evaluate(self, question: str, sql: str = None, tables_used=None) -> bool: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
class Server(ABC): | ||
@abstractmethod | ||
def __init__(self, settings: Settings): | ||
pass | ||
pass |
Oops, something went wrong.