Skip to content

edsnlp.processing.helpers

DataFrames = None module-attribute

spec = importlib.util.find_spec(module.value) module-attribute

DataFrameModules

Bases: Enum

Source code in edsnlp/processing/helpers.py
 9
10
11
12
class DataFrameModules(Enum):
    PANDAS = "pandas"
    PYSPARK = "pyspark.sql"
    KOALAS = "databricks.koalas"

PANDAS = 'pandas' class-attribute

PYSPARK = 'pyspark.sql' class-attribute

KOALAS = 'databricks.koalas' class-attribute

get_module(df)

Source code in edsnlp/processing/helpers.py
26
27
28
29
def get_module(df: DataFrames):
    for module in list(DataFrameModules):
        if df.__class__.__module__.startswith(module.value):
            return module

check_spacy_version_for_context()

Source code in edsnlp/processing/helpers.py
32
33
34
35
36
37
38
39
40
41
def check_spacy_version_for_context():  # pragma: no cover
    import spacy

    spacy_version = getattr(spacy, "__version__")
    if LooseVersion(spacy_version) < LooseVersion("3.2"):
        raise VersionConflict(
            "You provided a `context` argument, which only work with spacy>=3.2.\n"
            f"However, we found SpaCy version {spacy_version}.\n",
            "Please upgrade SpaCy ;)",
        )
Back to top