From e0f2d39130a7db10f4f71be7134fa9db26cd026e Mon Sep 17 00:00:00 2001 From: Egor Dmitriev Date: Thu, 2 Sep 2021 11:55:56 +0200 Subject: [PATCH] [BUGFIX] Added max length to rich text property --- .github/workflows/test.yml | 2 +- notionsci/connections/notion/common.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 08e013e..77e711d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.9 ] + python-version: [ 3.7 ] steps: - uses: actions/checkout@v2 - name: Use Python ${{ matrix.python-version }} diff --git a/notionsci/connections/notion/common.py b/notionsci/connections/notion/common.py index fecd500..ef3f748 100644 --- a/notionsci/connections/notion/common.py +++ b/notionsci/connections/notion/common.py @@ -248,9 +248,10 @@ def as_date(date: dt.datetime) -> 'Property': @staticmethod def as_rich_text(text: str) -> 'Property': + # Max length = 2000 return Property( type=PropertyType.rich_text, - rich_text=[RichText.from_text(text or '')] + rich_text=[RichText.from_text((text or '')[:2000])] ) @staticmethod