RelationalAI / rai-sdk-python

The RelationalAI Software Development Kit (SDK) for Python.
Apache License 2.0
17 stars 4 forks source link

Example `create_database.py` broken #88

Closed Ally-R closed 2 years ago

Ally-R commented 2 years ago

In rai-sdk-python/examples

$ python3 ./create_database.py example-db-name
Traceback (most recent call last):
  File "./create_database.py", line 37, in <module>
    run(args.database, args.profile)
  File "./create_database.py", line 26, in run
    rsp = api.create_database(ctx, database)
TypeError: create_database() missing 1 required positional argument: 'engine'
salamehsameera commented 2 years ago

@Ally-R this looks like an old version of the sdk to me. Can you please make sure you're on the 'main' (not master) branch and do a git pull? I just tried to create a database and it worked:

python3 ./create_database.py ss-test-db
{
  "database": {
    "account_name": .....
    "name": "ss-test-db",
    "id": ...
    "state": "CREATED",
    "region": "us-east",
    "created_on": "2022-07-06T12:20:07.317Z",
    "created_by": ...
  }
}
Ally-R commented 2 years ago

Hmm, I'm not sure what's going on. I pulled from main and it is up-to-date. I also ran pip3 install rai-sdk to make sure that's up-to-date (unless there is another method to update?). I am still getting the same error.

rai-sdk-python create-database issue
Ally-R commented 2 years ago

I see that in the code create_database should not require a third input https://github.com/RelationalAI/rai-sdk-python/blob/783caed5694700c1cbd861c0329a44cb0cf36542/railib/api.py#L514

So it must be an issue with my setup... just not sure how to fix it

Ally-R commented 2 years ago

Upon further investigation, it seems that create_database is indeed correct, and the issue is that the SDK version with pip is not updated. This is a known issue. See https://relationalai.slack.com/archives/C02C9AV2LL9/p1657196305040269

billscheidel-rai commented 1 year ago

Note: This issue has been migrated to https://relationalai.atlassian.net/browse/RAI-5859.

This link is only accessible to employees of RelationalAI.