-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add zotero handler implementation #9084
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ElinaKapetanaki,
To continue our conversation on Slack here: is the pyzotero
package installed in your virtual environment?
Yes pyzotero is installed in my mindsdb-venv. |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ElinaKapetanaki,
Thank you very much for this great contribution!
I've got a couple of requests:
- Can you please resolve the conflicts here by merging the main branch into yours, please? The branches seem to be out of sync.
- Can you please post a few screenshots or a quick video of this handler working as expected?
Hello @MinuraPunchihewa , Also I would like to post a screenshot of the tests for the handler passing as well: |
I also fixed the conflict problem. |
@ZoranPandovski Do you know the reason why this workflow is failing? |
That action deploys to our cloud dev environment by labeling the PR; we can ignore that. If this is ready, we can merge it tomorrow |
@ZoranPandovski What about the Test on Push failing with the error "Running on Github Actions but GITHUB_TOKEN is not set."? |
From my part, I think everything is ready and you can see it working in the link I have in above comments. This was my first ever PR, so I am very excited about merging tommorrow!! @MinuraPunchihewa @ZoranPandovski |
Goodmorning!! Are we merging this today? @MinuraPunchihewa @ZoranPandovski |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please split ZoteroHandler
and AnnotationsTable
into their own modules? We can call them zotero_handler.py
and zotero_tables.py
. This will make it easier to add support for more tables (if any) moving forward?
df = self.call_find_annotations_zotero_api(method_name, params) | ||
return Response(RESPONSE_TYPE.TABLE, data_frame=df) | ||
|
||
def call_find_annotations_zotero_api(self, method_name: str = None, params: dict = None) -> pd.DataFrame: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please move this method to AnnotationsTable
? Personally, I am not the biggest fan of including this function within the handler class, especially with the use of method_name
parameter.
When moving it, since it does not require to be generic as such, we can maybe remove the method_name
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method_name
from what I see can take 3 values : items, (to get all annotations) item (to get 1 annotation) or children (to get the annotations of for ex. a specific article), because these are 3 methods that are used from the API . So I am not sure if we can remove it, since that information must be passed to the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Instead of removing it, can we then give it a more meaningful name? When moving it to the Table class, I think you could even break it down into three functions like get_items()
, get_items()
and get_item_children()
.
The approach to take there is completely up to you; my only request is that we move this method to the class where the logic belongs.
Description
This is the Zotero Handler Implementation that is focused -for now- at connecting to the Zotero library of a user and selecting his/her annotations, which is highlighted text on research material (either all annotations, a specific one or all annotations on a specific item, like on a specific book). More information about the implementation can be found on the README file of the handler.
Also QA test is in this link showing that everything runs correctly https://github.com/ElinaKapetanaki/mindsdb-test/blob/main/Zotero_QA.MD
Fixes #5637
Type of change
Verification Process
To ensure the changes are working as expected:
Checklist: