From 9eace24f583114689ceea4d4e21196229ba36be3 Mon Sep 17 00:00:00 2001 From: noahharel Date: Sun, 17 Dec 2023 16:32:16 +0200 Subject: [PATCH 1/6] deprecate title_or_node_id --- knowledge_graph/querying.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/knowledge_graph/querying.py b/knowledge_graph/querying.py index 78922fb..df18444 100644 --- a/knowledge_graph/querying.py +++ b/knowledge_graph/querying.py @@ -2,6 +2,7 @@ import functools from typing import Callable, Dict, FrozenSet, Iterable, Optional, Tuple +import deprecated import gamla from . import ( @@ -195,9 +196,11 @@ def find_exactly(text: str): ) -title_or_node_id = gamla.first( - get_node_title, storage.node_id, exception_type=NodeTitleMissing +@deprecated.deprecated( + reason="ID can be anything, which makes this function unexpected. Use `get_node_title` or 'node_id' instead." ) +def title_or_node_id(node: storage.Node) -> str: + return gamla.first(get_node_title, storage.node_id, exception_type=NodeTitleMissing)(node) @gamla.curry From 3145cd0b55222489bbfea9836786716b315c62fc Mon Sep 17 00:00:00 2001 From: noahharel Date: Sun, 17 Dec 2023 17:56:25 +0200 Subject: [PATCH 2/6] add deprecated to setup --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index ad7f3f2..3cec6ff 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ packages=setuptools.find_namespace_packages(), install_requires=[ "dataclasses_json==0.5.7", + "deprecated", "immutables", "pytest", "phonenumbers", From 1e3488d1ed471dc2d6c05c16f382236ee46364c4 Mon Sep 17 00:00:00 2001 From: noahharel Date: Sun, 17 Dec 2023 18:24:29 +0200 Subject: [PATCH 3/6] stop updating pip --- .github/workflows/python-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0bedfb0..dc74a9d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,7 +20,6 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip pip install setuptools wheel twine pip install cloud-utils@https://github.com/hyroai/cloud-utils/tarball/master - name: Build and publish From 652ee11f756bc125ccbdc7fcc88bacf93bcbc5af Mon Sep 17 00:00:00 2001 From: noahharel Date: Sun, 17 Dec 2023 18:52:34 +0200 Subject: [PATCH 4/6] immutables version --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/python-publish.yml | 1 + setup.py | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0=0.18", "pytest", "phonenumbers", ], From 068f5831ac6fe3a1a4af3a14f1337a3dda93a557 Mon Sep 17 00:00:00 2001 From: noahharel Date: Tue, 19 Dec 2023 16:09:22 +0200 Subject: [PATCH 5/6] check if can be built --- knowledge_graph/querying.py | 6 +++--- setup.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/knowledge_graph/querying.py b/knowledge_graph/querying.py index df18444..7868aa5 100644 --- a/knowledge_graph/querying.py +++ b/knowledge_graph/querying.py @@ -196,9 +196,9 @@ def find_exactly(text: str): ) -@deprecated.deprecated( - reason="ID can be anything, which makes this function unexpected. Use `get_node_title` or 'node_id' instead." -) +# @deprecated.deprecated( +# reason="ID can be anything, which makes this function unexpected. Use `get_node_title` or 'node_id' instead." +# ) def title_or_node_id(node: storage.Node) -> str: return gamla.first(get_node_title, storage.node_id, exception_type=NodeTitleMissing)(node) diff --git a/setup.py b/setup.py index 39a2d02..2f00155 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ packages=setuptools.find_namespace_packages(), install_requires=[ "dataclasses_json==0.5.7", - "deprecated", "immutables>=0.18", "pytest", "phonenumbers", From 05956c9f34b5a878b4ca5840ca11fa4219e59a25 Mon Sep 17 00:00:00 2001 From: noahharel Date: Wed, 20 Dec 2023 12:34:35 +0200 Subject: [PATCH 6/6] re-add deprecation --- knowledge_graph/querying.py | 6 +++--- setup.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/knowledge_graph/querying.py b/knowledge_graph/querying.py index 7868aa5..df18444 100644 --- a/knowledge_graph/querying.py +++ b/knowledge_graph/querying.py @@ -196,9 +196,9 @@ def find_exactly(text: str): ) -# @deprecated.deprecated( -# reason="ID can be anything, which makes this function unexpected. Use `get_node_title` or 'node_id' instead." -# ) +@deprecated.deprecated( + reason="ID can be anything, which makes this function unexpected. Use `get_node_title` or 'node_id' instead." +) def title_or_node_id(node: storage.Node) -> str: return gamla.first(get_node_title, storage.node_id, exception_type=NodeTitleMissing)(node) diff --git a/setup.py b/setup.py index 2f00155..39a2d02 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ packages=setuptools.find_namespace_packages(), install_requires=[ "dataclasses_json==0.5.7", + "deprecated", "immutables>=0.18", "pytest", "phonenumbers",