jamalex / jamalex/notion-py

Option is duplicated in Select

Open
#302 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.4k
Forks
470
PR merge metrics
No merged PRs in 30d

Description

Hi,

I had been using `set_property()` to fill options for column fields in Collection.
From a few days ago, this makes duplication of options.

Let say there is "A" option in "Status" column (or property).
"A" is predefined for "Status"

```
note = parent_note.collection.add_row()
note.title = "This is a new note"
note.note.set_property('Status', 'A') # (or I tried note.status = 'A' too, and it had the same result.)
```

This snippet still makes a new note and add "A" option for "Type" well, but _strangely makes another "A" option as well_.
As a result, when I click the "Type" cell in the web page, it shows me multiple "A"s.

![image](https://user-images.githubusercontent.com/16931755/111161573-a573dd80-85de-11eb-94e1-fdb8829856dd.png)
This is the picture in the first place before I run the code, and what I am expecting after the run.

However, after I run the code, it goes like this.
![image](https://user-images.githubusercontent.com/16931755/111161943-fdaadf80-85de-11eb-96ba-f8bb9c3bfdff.png)
In this image, just one "A" is added, but sometimes it gets multiplied.

There is no question related to my problem recently, so I wonder if I did something wrong, but I have not changed anything except the Notion Token value.
(I do not know why, but recently the previous one did not work so I had to change.)

Is there anything I can check?

---
+ Additional information
I am using notion-py by pip installation. (notion v0.0.28)
When I downloaded whole project and ran my code under the project, it does not make duplication.
I do not have much experience handling codes, so still the reason is unknown.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the set_property() path and the Select option handling, using the reported snippet as the reproduction. Compare behavior from the pip-installed notion v0.0.28 with the downloaded project checkout, then verify that assigning a predefined option does not create duplicate options.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.