Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symplify usage #71

Merged
merged 15 commits into from
Sep 21, 2023
Merged

Symplify usage #71

merged 15 commits into from
Sep 21, 2023

Conversation

ea-rus
Copy link
Contributor

@ea-rus ea-rus commented Sep 7, 2023

Updated python SDK API

Changes:

  1. Added attributes to access to objects (named as object collection):
  • Project has:
    • .models, .jobs, .views
  • Database has:
    • .tables
  • Connection has:
    • .databases, .projects, .ml_engines
    • and all attributes of 'mindsdb' project. It means that connection is also project

Object collections have similar set of attributes

  • get
  • list
  • create
  • drop
    Other attributes are interpreted as access to object itself.

Example for tables:

db = con.databases.example_db

# get table
db.tables.get('my_table')

# get the same table as attribute
db.tables.my_table

Old API also works

  1. Support of ml_engines (create, view, drop)

  2. method to wait till training complete
    model.wait_complete()

  3. Support update table (from dict or query)

  4. Support insert to table (from query or dataframe)

  5. Support delete from table

  6. kwargs for modles.create are interpreted as options to model

  7. Added examples folder

  8. updated documentation, tests

  9. Support of ml_handlers and data_handlers (list, get)

close: mindsdb/mindsdb#7233

QA info

Clone branch and go through test examples:
https://github.com/mindsdb/mindsdb_python_sdk/tree/fc39a14ba60ce804c65f5b83c9a184d2f92387de/examples

- server is also mindsdb project
- collections to access objects via attributes
  - .databases .projects in server
  - .models .jobs .views in project
  - .tables in database
- update table (from dict or query)
- insert to table (from query or dataframe)
- delete from table
- moved docstrings
- moved method to object collections
@ea-rus ea-rus marked this pull request as ready for review September 14, 2023 13:46
@ea-rus ea-rus merged commit 7ec2ac4 into staging Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python SDK Simplification
1 participant