Skip to content

Commit

Permalink
TypeError: Can't instantiate abstract class DbResource without an imp…
Browse files Browse the repository at this point in the history
…lementation for abstract method 'answer'
  • Loading branch information
中山亜蘭 committed Oct 11, 2024
1 parent ffae625 commit 47ecfe8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
24 changes: 21 additions & 3 deletions examples/use-rdb-resource/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# Access Database resources and inference by DANA

Check notice on line 1 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L1

Expected: [None]; Actual: # Access Database resources and inference by DANA

## Commands for set-up and run
## Setting-up

Check notice on line 3 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L3

Expected: 1; Actual: 0; Below
- What you need

Check notice on line 4 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L4

Lists should be surrounded by blank lines
- commands (if you are mac user, you can install those things by Homebrew)
- mysql
- Also, create or use existing database for this example.

Check notice on line 7 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L7

Expected: 6; Actual: 8
- poetry
- API Key
- Use your own OpenAI API key

- Setting up Commands
- `cd examples/use-rdb-resource`
- `poetry install`
- `cp .env.template .env`
- update .env data with your environment data
- `poetry run python make_example_table_data.py`
- if this command doesn't work, then run `poetry env use 3.12`
- change python version to resolve dependensies version
-

Check notice on line 20 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L20

Expected: 0 or 2; Actual: 1


Check notice on line 22 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L22

Expected: 1; Actual: 2
## What is this example doing?

## What is this folder doing?

Check notice on line 25 in examples/use-rdb-resource/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/README.md#L25

Expected: 1; Actual: 2
## Check Result
3 changes: 2 additions & 1 deletion examples/use-rdb-resource/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from myvanna import generate_sql_from_prompt, MyVanna

Check warning on line 1 in examples/use-rdb-resource/main.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

examples/use-rdb-resource/main.py#L1

Unused MyVanna imported from myvanna
from openssa import DANA, DbResource
from openssa import DANA
from openssa.core.resource.db import DbResource
from dotenv import load_dotenv

load_dotenv()
Expand Down
5 changes: 4 additions & 1 deletion examples/use-rdb-resource/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
python = ">=3.12,<3.13"
pymysql = "^1.1.1"
kaleido = "0.2.1"
vanna = "^0.7.3"
chromadb = "^0.5.11"
faker = "^30.1.0"
sqlalchemy = "^2.0.35"
openai = "^1.51.2"
openssa = "^0.24.10.10"


[build-system]
Expand Down

0 comments on commit 47ecfe8

Please sign in to comment.