DerwenAI / kglab

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, NetworkX, RAPIDS, RDFlib, pySHACL, PyVis, morph-kgc, pslpython, pyarrow, etc.
https://derwen.ai/docs/kgl/
MIT License
574 stars 65 forks source link

Prefix strings with `r` to avoid `DeprecationWarning` and `W1401` #264

Closed tomaarsen closed 2 years ago

tomaarsen commented 2 years ago

I noticed some warnings in the CI runs for #263:

=============================== warnings summary ===============================
kglab/query/sparql.py:195
  /opt/kglab/kglab/query/sparql.py:195: DeprecationWarning: invalid escape sequence \?
    pattern = re.compile("(\?" + var + ")(\W)")  # pylint: disable=W1401

kglab/query/sparql.py:195
  /opt/kglab/kglab/query/sparql.py:195: DeprecationWarning: invalid escape sequence \W
    pattern = re.compile("(\?" + var + ")(\W)")  # pylint: disable=W1401

So I've updated this line to use the r string prefix instead.

Mec-iS commented 2 years ago

cool, ~we need to wait for #263 to be merged first, as the querying module has been moved to query.mixin~

tomaarsen commented 2 years ago

I'm unsure why the merging is still blocked... Odd

Mec-iS commented 2 years ago

yea same.

ceteri commented 2 years ago

GH has been prompting to update repos to "protect" their main branches, and I've mirrored the pytextrank settings here on kglab

It will require a review before merging a PR now, although I'm baffled by some of the warnings that I'm seeing.

I have a hunch that GH hasn't ironed out all the bugs quite yet for their new "protect" features.

ceteri commented 2 years ago

Also, @tomaarsen many thanks!

tomaarsen commented 2 years ago

Gladly!