jamalex / jamalex/notion-py

Columns should be namespaced (e.g. under `_columns`)

Open
#98 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
4.4k
Forks
470
PR merge metrics
No merged PRs in 30d

Description

> Note: For convenience, we automatically map the database "columns" (aka properties), based on the schema defined in the Collection, into getter/setter attributes on the CollectionRowBlock instances.

This should be namespaced to avoid clashing with class members. E.g. in the following the column `remove` clashes with the method `remove`:

```python
In [84]: row.remove # this returns a method, not the column (see below)
Out[84]: >

In [85]: coll.get()
Out[85]:
{'id': 'be92dd44-...-c77316403c58',
'version': 28,
'name': [['Labels per repo']],
'schema': {'"-z;': {'name': 'remove', 'type': 'text'}, # here's the `remove` column
'Pq($': {'name': 'Description', 'type': 'text'},
'S0=w': {'name': 'Color', 'type': 'text'},
'u&]8': {'name': 'Repository',
'type': 'relation',
'property': '/lVl',
'collection_id': '60f1e59a-...-9b030f1b9c4b'},
'title': {'name': 'Label', 'type': 'title'}},
'format': {'collection_page_properties': [{'visible': True,
'property': 'Pq($'},
{'visible': True, 'property': 'S0=w'}]},
'parent_id': 'cb6fb9a3-...-b77de1bb8ed7',
'parent_table': 'block',
'alive': True}

In [86]: row.repository # this returns a cell value
Out[86]:
[,
]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the CollectionRowBlock logic that maps schema columns into getter/setter attributes, using the reported `remove` and `repository` examples as references. Done means column values are available under a namespace such as `_columns` without clashing with CollectionRowBlock methods, while existing column access behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
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.