Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematic 24.7.1 Release #1454

Merged
merged 144 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
9851c10
Merge branch 'develop-required-validation-rule-FDS-1626' into develop
andrewelamb Apr 16, 2024
bdc60fb
mypy formated some schema files
andrewelamb Apr 16, 2024
e2e5b7f
mypy formatted schema files
andrewelamb Apr 16, 2024
8597841
mypy formatted schema files
andrewelamb Apr 16, 2024
be21a91
mypy schema file
andrewelamb Apr 16, 2024
bb9f873
mypy format schema files
andrewelamb Apr 16, 2024
cc50274
mypy formatted schema file
andrewelamb Apr 16, 2024
69dfa08
add schema module to mypy github workfow
andrewelamb Apr 16, 2024
4bd3730
Merge branch 'develop' into develop-FDS-243-mypy-schema-module
andrewelamb Apr 16, 2024
d72407b
lint test file
andrewelamb Apr 16, 2024
c0df0e8
create copies of manifests to alter for test
andrewelamb Apr 16, 2024
4405afc
fixed spacing
andrewelamb Apr 16, 2024
e270286
add back code to automatically save the JSON Validation schema
mialy-defelice Apr 17, 2024
12ee6cc
move fixture from test file to conftest
andrewelamb Apr 18, 2024
b66e4fb
test not uses fixtures instead of making its own copies of manifests
andrewelamb Apr 18, 2024
acbe03d
fix typo in docstring
andrewelamb Apr 18, 2024
f85a05a
run black
mialy-defelice Apr 18, 2024
1705b4e
add encoding to satisfy pylinting
mialy-defelice Apr 18, 2024
7cc4430
Merge branch 'develop' into develop-FDS-243-mypy-schema-module
andrewelamb Apr 19, 2024
ba2fb48
handle merge conflict
andrewelamb Apr 22, 2024
3fb3254
move logic to create JSON Schema log file name to a helper, so it can…
mialy-defelice Apr 22, 2024
bff2f90
change parameter name to get_json_schema_log_file_path
mialy-defelice Apr 22, 2024
0dedc00
update param name in schema_utils too
mialy-defelice Apr 22, 2024
00d7d68
test that the file can be made properly
mialy-defelice Apr 22, 2024
ac359a2
add test for get_json_schema_log_file_path
mialy-defelice Apr 23, 2024
d8947c6
run black
mialy-defelice Apr 23, 2024
c5955bd
fix merge conflict
mialy-defelice Apr 23, 2024
7e5144c
run black on schema_utils
mialy-defelice Apr 23, 2024
98e8e6b
added pydantic to toml file
andrewelamb Apr 30, 2024
214b9e0
update pandas and numpy
andrewelamb May 3, 2024
1f7a8c6
add jaeger-client and flask open tracing
linglp May 8, 2024
f955a25
add tracer for /manifest/generate
linglp May 8, 2024
b627483
update tests to use indirect and fixture properly
linglp May 9, 2024
f06b19a
update to use different fixture
linglp May 9, 2024
4366106
merge with main
linglp May 9, 2024
add00c0
add decorator
linglp May 10, 2024
107b69c
Merge pull request #1416 from Sage-Bionetworks/develop-FDS-243-mypy-s…
andrewelamb May 10, 2024
8f4f26a
Merge pull request #1412 from Sage-Bionetworks/bugfix-FDS-1686-test-m…
andrewelamb May 10, 2024
96faecc
Merge pull request #1419 from Sage-Bionetworks/develop-FDS-1982-add-p…
andrewelamb May 10, 2024
73f2b11
handle merge conflict, recreate lock file
andrewelamb May 10, 2024
5eca2a1
Merge pull request #1421 from Sage-Bionetworks/develop-FDS-1320-updat…
andrewelamb May 10, 2024
bee84ac
add tracers
linglp May 10, 2024
c554975
add file exporter
linglp May 13, 2024
c932502
removed typing extensions lock
andrewelamb May 13, 2024
13eb80a
merge with develop, resolve conflicts
mialy-defelice May 13, 2024
0240dbe
run black
mialy-defelice May 13, 2024
188c7cf
Merge pull request #1432 from Sage-Bionetworks/develop-FDS-511-typing…
andrewelamb May 15, 2024
570ee62
Merge pull request #1415 from Sage-Bionetworks/develop-FDS-871-save-J…
mialy-defelice May 16, 2024
834c2c3
add version force param
SageGJ May 31, 2024
4fcded0
merge changes from develop
linglp Jun 3, 2024
297abb1
edit tracing
linglp Jun 5, 2024
0185d13
update config
linglp Jun 5, 2024
c428afd
update config in readme
linglp Jun 5, 2024
d33ec25
remove service_acc_creds_synapse_id
linglp Jun 5, 2024
a1edc5a
remove test that is no longer relevant
linglp Jun 5, 2024
c314252
remove download creds function
linglp Jun 5, 2024
caf267f
reformat code
linglp Jun 5, 2024
71392bf
remove breakpoint
linglp Jun 5, 2024
c33d1bb
remove unused import
linglp Jun 5, 2024
9c25e90
add maintainers to Dockerfile
SageGJ Jun 5, 2024
2fdc075
add version tag to labels
SageGJ Jun 5, 2024
0668cb7
update maintainer format
SageGJ Jun 5, 2024
d1aafac
readd email, formatting
SageGJ Jun 6, 2024
71b474e
add tracing related to manifest submission
linglp Jun 6, 2024
301ca0c
add jsonify
linglp Jun 6, 2024
f94e297
modify init to add tracing
linglp Jun 6, 2024
7d81c19
remove jsonify
linglp Jun 6, 2024
a84521d
handle exception in schematic api
linglp Jun 6, 2024
c05a1a6
add docstring
linglp Jun 6, 2024
36687c2
remove unused import
linglp Jun 6, 2024
1d910f7
raise synapse authentication errors correctly
linglp Jun 6, 2024
63e1bb2
handle synapse access error
linglp Jun 6, 2024
093a48a
run black
linglp Jun 6, 2024
a869b16
add docstring
linglp Jun 6, 2024
9a9d372
add type hinting
linglp Jun 6, 2024
c61bc7d
add type hinting
linglp Jun 6, 2024
7c432e1
add test
linglp Jun 6, 2024
9f6c526
add tests
linglp Jun 6, 2024
eddaf6d
revert changes in toml
linglp Jun 6, 2024
f07256f
revert changes of lock file
linglp Jun 6, 2024
6fed680
add asyncio
linglp Jun 7, 2024
514f65e
Merge pull request #1436 from Sage-Bionetworks/develop-fds-1956
linglp Jun 10, 2024
ce840e0
temp
linglp Jun 10, 2024
bf8d8d4
store annotations async
linglp Jun 10, 2024
02ff5e9
add and store annos in an async way
linglp Jun 11, 2024
1fb6024
add type hinting
linglp Jun 11, 2024
91336c9
run black
linglp Jun 11, 2024
57ba492
merge changes from develop
linglp Jun 11, 2024
d6873cf
remove unused package
linglp Jun 11, 2024
423650c
Merge pull request #1437 from Sage-Bionetworks/develop-docker-info-FD…
GiaJordan Jun 12, 2024
85fd53a
Merge pull request #1438 from Sage-Bionetworks/develop-add-errors
linglp Jun 12, 2024
e62597b
delete unused funct
linglp Jun 13, 2024
33c33ec
preserve current behavior; add annos
linglp Jun 13, 2024
a09ea37
run black
linglp Jun 13, 2024
56a64c3
update to use synapseclient 4.3.0
linglp Jun 13, 2024
d32bbbd
update synapseclient veresion
linglp Jun 13, 2024
16e62d4
build separate function;raise error
linglp Jun 13, 2024
3824964
use pytest asyncio
linglp Jun 13, 2024
1efb134
add test
linglp Jun 13, 2024
2e53a33
fix store_annos
linglp Jun 14, 2024
f157669
add test_get_async_annotation
linglp Jun 14, 2024
ca629a2
add isort in pre-commit
linglp Jun 14, 2024
ac18c76
add assert statement
linglp Jun 14, 2024
1ae7335
rename and add typing
linglp Jun 14, 2024
c8a976b
add test of _add_annos and edit comment
linglp Jun 15, 2024
4addbab
fix test
linglp Jun 16, 2024
ff33bbf
remove add_annotation function
linglp Jun 16, 2024
f38c043
update tracer name
linglp Jun 16, 2024
0e05a24
add typing
linglp Jun 16, 2024
f7edf60
modify import
linglp Jun 16, 2024
514ead6
add comment
linglp Jun 16, 2024
ba1a062
resolve conflicts
linglp Jun 16, 2024
b113aa5
change import location
linglp Jun 17, 2024
7f4f2c1
black schematic-api
linglp Jun 17, 2024
8218fba
run black for all the tests
linglp Jun 17, 2024
f9543fc
remove unintended code
linglp Jun 17, 2024
47f40ac
updated typo
linglp Jun 17, 2024
cb17c5b
Merge pull request #1435 from Sage-Bionetworks/develop-version-increm…
GiaJordan Jun 17, 2024
ecde417
allow positional arguments to be used as well
linglp Jun 17, 2024
448ed27
resolve conflicts from develop
linglp Jun 17, 2024
29a00a2
remove sleep in test
linglp Jun 18, 2024
0ea1aec
update gh workflow
linglp Jun 18, 2024
ddfb9d5
Merge pull request #1442 from Sage-Bionetworks/develop-add-black-test…
linglp Jun 19, 2024
3871961
resolve conflicts and run black
linglp Jun 19, 2024
aafaf73
add test for changeFileMetaData function
linglp Jun 19, 2024
925e174
Merge pull request #1444 from Sage-Bionetworks/develop-ensure-forceve…
linglp Jun 19, 2024
72deede
Merge branch 'develop' into develop-tracing
linglp Jun 19, 2024
ff141f1
run black, remove unused commit
linglp Jun 19, 2024
9229884
remove tracing on initialize data model to avoid confusion
linglp Jun 20, 2024
64aba90
Merge pull request #1430 from Sage-Bionetworks/develop-tracing
linglp Jun 20, 2024
3577f13
add test for bugfix
SageGJ Jun 20, 2024
4e004b6
change behavior for records based manifests
SageGJ Jun 20, 2024
938ccc9
merge with develop and resolve conflicts
linglp Jun 20, 2024
adc4c01
fix test
linglp Jun 21, 2024
4795cd1
Merge pull request #1440 from Sage-Bionetworks/develop-async-set-anno…
linglp Jun 21, 2024
1bef8d7
Merge branch 'develop' into develop-modify-precommit
linglp Jun 21, 2024
0a75bd1
add test for file based manifest as well
SageGJ Jun 21, 2024
4141053
update test ids and name
SageGJ Jun 21, 2024
f01ad16
Merge pull request #1447 from Sage-Bionetworks/develop-file-records-m…
GiaJordan Jun 21, 2024
8dbb559
Merge pull request #1441 from Sage-Bionetworks/develop-modify-precommit
linglp Jun 21, 2024
76fb305
Revert "feat: set annotations in an async way when submitting a manif…
linglp Jun 27, 2024
9dd598a
Merge pull request #1451 from Sage-Bionetworks/revert-1440-develop-as…
linglp Jun 27, 2024
391b6d2
add argument for isort to work with black
linglp Jun 29, 2024
3f4185d
Merge pull request #1453 from Sage-Bionetworks/develop-fix-precommit
linglp Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
run: |
# ran only on certain files for now
# add here when checked
poetry run black schematic --check
poetry run black schematic tests schematic_api --check

#----------------------------------------------
# type checking/enforcement
Expand All @@ -101,7 +101,7 @@ jobs:
# add here when checked
# poetry run mypy --install-types --non-interactive
# add here when enforced
poetry run mypy --disallow-untyped-defs --install-types --non-interactive schematic/configuration/*.py schematic/exceptions.py schematic/help.py schematic/loader.py schematic/version.py schematic/visualization schematic/utils/
poetry run mypy --disallow-untyped-defs --install-types --non-interactive schematic/schemas/ schematic/configuration/ schematic/exceptions.py schematic/help.py schematic/loader.py schematic/version.py schematic/visualization schematic/utils/

#----------------------------------------------
# linting
Expand Down
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ repos:
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10
files: schematic/
files: ^(tests|schematic|schematic_api)/

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
files: ^(tests|schematic|schematic_api)/
args: ["--profile", "black", "--filter-files"]
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ model:

# This section is for using google sheets with Schematic
google_sheets:
# The Synapse id of the Google service account credentials.
service_acct_creds_synapse_id: "syn25171627"
# Path to the synapse config file, either absolute or relative to this file
service_acct_creds: "schematic_service_account_creds.json"
# When doing google sheet validation (regex match) with the validation rules.
Expand Down
2 changes: 0 additions & 2 deletions config_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ model:

# This section is for using google sheets with Schematic
google_sheets:
# The Synapse id of the Google service account credentials.
service_acct_creds_synapse_id: "syn25171627"
# Path to the synapse config file, either absolute or relative to this file
service_acct_creds: "schematic_service_account_creds.json"
# When doing google sheet validation (regex match) with the validation rules.
Expand Down
1,595 changes: 866 additions & 729 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ graphviz = "^0.20.0"
inflection = "^0.5.1"
jsonschema = "^4.0.0"
networkx = ">=2.2.8"
numpy = "^1.21.1"
numpy = "^1.26.4"
oauth2client = "^4.1.0" # Specified because of bug in version ^4.0.0
pandas = "^2.0.0"
pandas = "^2.2.2"
pygsheets = "^2.0.4"
PyYAML = "^6.0.0"
rdflib = "^6.0.0"
Expand All @@ -67,16 +67,18 @@ dateparser = "^1.1.4"
pandarallel = "^1.6.4"
schematic-db = {version = "0.0.41", extras = ["synapse"]}
pyopenssl = {version = "^23.0.0", optional = true}
typing-extensions = "<4.6.0"
dataclasses-json = "^0.6.1"
pydantic = "^1.10.4"
connexion = {extras = ["swagger-ui"], version = "^2.8.0", optional = true}
Flask = {version = "2.1.3", optional = true}
Flask-Cors = {version = "^3.0.10", optional = true}
uWSGI = {version = "^2.0.21", optional = true}
Jinja2 = {version = ">2.11.3", optional = true}
jaeger-client = {version = "^4.8.0", optional = true}
flask-opentracing = {version="^2.0.0", optional = true}

[tool.poetry.extras]
api = ["connexion", "Flask", "Flask-Cors", "Jinja2", "pyopenssl"]
api = ["connexion", "Flask", "Flask-Cors", "Jinja2", "pyopenssl", "jaeger-client", "flask-opentracing"]
aws = ["uWSGI"]


Expand Down
8 changes: 0 additions & 8 deletions schematic/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,6 @@ def model_location(self) -> str:
"""
return self._model_config.location

@property
def service_account_credentials_synapse_id(self) -> str:
"""
Returns:
str: The Synapse id of the Google service account credentials.
"""
return self._google_sheets_config.service_acct_creds_synapse_id

@property
def service_account_credentials_path(self) -> str:
"""
Expand Down
3 changes: 0 additions & 3 deletions schematic/configuration/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,10 @@ class GoogleSheetsConfig:
strict_validation: When doing google sheet validation (regex match) with the validation rules.
True is alerting the user and not allowing entry of bad values.
False is warning but allowing the entry on to the sheet.
service_acct_creds_synapse_id: The Synapse id of the Google service account credentials.
service_acct_creds: Path to the Google service account credentials,
either absolute or relative to this file
"""

service_acct_creds_synapse_id: str = "syn25171627"
service_acct_creds: str = "schematic_service_account_creds.json"
strict_validation: bool = True

Expand All @@ -151,7 +149,6 @@ def validate_string_is_not_empty(cls, value: str) -> str:
raise ValueError(f"{value} is an empty string")
return value

@validator("service_acct_creds_synapse_id")
@classmethod
def validate_synapse_id(cls, value: str) -> str:
"""Check if string is a valid synapse id
Expand Down
13 changes: 13 additions & 0 deletions schematic/manifest/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
from schematic.configuration.configuration import CONFIG
from schematic.utils.google_api_utils import export_manifest_drive_service

from opentelemetry import trace

logger = logging.getLogger(__name__)
tracer = trace.get_tracer("Schematic")


class ManifestGenerator(object):
Expand Down Expand Up @@ -1289,6 +1291,7 @@ def _gather_all_fields(self, fields, json_schema):
)
return required_metadata_fields

@tracer.start_as_current_span("ManifestGenerator::get_empty_manifest")
def get_empty_manifest(
self,
strict: Optional[bool],
Expand Down Expand Up @@ -1334,6 +1337,7 @@ def _get_missing_columns(self, headers_1: list, headers_2: list) -> list:
"""
return set(headers_1) - set(headers_2)

@tracer.start_as_current_span("ManifestGenerator::set_dataframe_by_url")
def set_dataframe_by_url(
self,
manifest_url: str,
Expand Down Expand Up @@ -1425,6 +1429,7 @@ def map_annotation_names_to_display_names(
# Use the above dictionary to rename columns in question
return annotations.rename(columns=label_map)

@tracer.start_as_current_span("ManifestGenerator::get_manifest_with_annotations")
def get_manifest_with_annotations(
self, annotations: pd.DataFrame, strict: Optional[bool] = None
) -> Tuple[ps.Spreadsheet, pd.DataFrame]:
Expand Down Expand Up @@ -1465,6 +1470,7 @@ def get_manifest_with_annotations(

return manifest_url, manifest_df

@tracer.start_as_current_span("ManifestGenerator::export_sheet_to_excel")
def export_sheet_to_excel(
self, title: str = None, manifest_url: str = None, output_location: str = None
) -> str:
Expand Down Expand Up @@ -1514,6 +1520,7 @@ def export_sheet_to_excel(

return output_excel_file_path

@tracer.start_as_current_span("ManifestGenerator::_handle_output_format_logic")
def _handle_output_format_logic(
self,
output_format: str = None,
Expand Down Expand Up @@ -1570,6 +1577,7 @@ def _handle_output_format_logic(
return dataframe

@staticmethod
@tracer.start_as_current_span("ManifestGenerator::create_single_manifest")
def create_single_manifest(
path_to_data_model: str,
graph_data_model: nx.MultiDiGraph,
Expand Down Expand Up @@ -1623,6 +1631,7 @@ def create_single_manifest(
return result

@staticmethod
@tracer.start_as_current_span("ManifestGenerator::create_manifests")
def create_manifests(
path_to_data_model: str,
data_types: list,
Expand Down Expand Up @@ -1751,6 +1760,7 @@ def create_manifests(

return all_results

@tracer.start_as_current_span("ManifestGenerator::get_manifest")
def get_manifest(
self,
dataset_id: str = None,
Expand Down Expand Up @@ -1998,6 +2008,9 @@ def _format_new_excel_column(self, worksheet, new_column_index: int, col: str):
)
return worksheet

@tracer.start_as_current_span(
"ManifestGenerator::populate_existing_excel_spreadsheet"
)
def populate_existing_excel_spreadsheet(
self, existing_excel_path: str = None, additional_df: pd.DataFrame = None
):
Expand Down
4 changes: 4 additions & 0 deletions schematic/models/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
from schematic.utils.df_utils import load_df

from schematic.models.validate_manifest import validate_all
from opentelemetry import trace

logger = logging.getLogger(__name__)

tracer = trace.get_tracer("Schematic")


class MetadataModel(object):
"""Metadata model wrapper around schema.org specification graph.
Expand Down Expand Up @@ -317,6 +320,7 @@ def populateModelManifest(
manifestPath, emptyManifestURL, return_excel=return_excel, title=title
)

@tracer.start_as_current_span("MetadataModel::submit_metadata_manifest")
def submit_metadata_manifest( # pylint: disable=too-many-arguments, too-many-locals
self,
manifest_path: str,
Expand Down
8 changes: 5 additions & 3 deletions schematic/schemas/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import time
import re
from typing import get_args
from typing import get_args, Optional, Any

import click
import click_log # type: ignore
Expand All @@ -29,7 +29,7 @@
# invoke_without_command=True -> forces the application not to show aids before
# losing them with a --h
@click.group(context_settings=CONTEXT_SETTINGS, invoke_without_command=True)
def schema(): # use as `schematic model ...`
def schema() -> None: # use as `schematic model ...`
"""
Sub-commands for Schema related utilities/methods.
"""
Expand Down Expand Up @@ -59,7 +59,9 @@ def schema(): # use as `schematic model ...`
metavar="<OUTPUT_PATH>",
help=query_dict(schema_commands, ("schema", "convert", "output_jsonld")),
)
def convert(schema, data_model_labels, output_jsonld):
def convert(
schema: Any, data_model_labels: DisplayLabelType, output_jsonld: Optional[str]
) -> None:
"""
Running CLI to convert data model specification in CSV format to
data model in JSON-LD format.
Expand Down
28 changes: 20 additions & 8 deletions schematic/schemas/data_model_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import networkx as nx # type: ignore
import graphviz # type: ignore
from opentelemetry import trace

from schematic.schemas.data_model_edges import DataModelEdges
from schematic.schemas.data_model_nodes import DataModelNodes
Expand All @@ -20,22 +21,27 @@
from schematic.utils.viz_utils import visualize
from schematic.utils.validate_utils import rule_in_rule_list

logger = logging.getLogger(__name__)


logger = logging.getLogger(__name__)
tracer = trace.get_tracer("Schematic")


class DataModelGraphMeta: # pylint: disable=too-few-public-methods
"""DataModelGraphMeta"""

_instances: dict = {}

def __call__(cls, *args: Any, **kwargs: Any): # pylint: disable=no-self-argument
def __call__( # pylint: disable=no-self-argument
cls, *args: Any, **kwargs: Any
) -> Any:
"""
Possible changes to the value of the `__init__` argument do not affect
the returned instance.
"""
if cls not in cls._instances:
instance = super().__call__(*args, **kwargs) # pylint: disable=no-member
instance = super().__call__(*args, **kwargs) # type: ignore # pylint: disable=no-member
cls._instances[cls] = instance
return cls._instances[cls]

Expand Down Expand Up @@ -83,6 +89,7 @@ def __init__(
)
self.graph = self.generate_data_model_graph()

@tracer.start_as_current_span("DataModelGraph::generate_data_model_graph")
def generate_data_model_graph(self) -> nx.MultiDiGraph:
"""
Generate NetworkX Graph from the Relationships/attributes dictionary, the graph is built
Expand Down Expand Up @@ -295,14 +302,14 @@ def get_component_node_validation_rules(
manifest_component: str,
node_label: Optional[str] = None,
node_display_name: Optional[str] = None,
) -> list[str]:
) -> list:
"""Get valdation rules for a given node and component.
Args:
manifest_component: str, manifest component display name that the node belongs to.
node_label: str, Label of the node you would want to get the comment for.
node_display_name: str, node display name for the node being queried.
Returns:
validation_rules: list[str], validation rules list for a given node and component.
validation_rules: list, validation rules list for a given node and component.
"""
# get any additional validation rules associated with this node (e.g. can this node
# be mapped to a list of other nodes)
Expand All @@ -312,11 +319,14 @@ def get_component_node_validation_rules(

# Parse the validation rules per component if applicable
if node_validation_rules and isinstance(node_validation_rules, dict):
node_validation_rules = extract_component_validation_rules(
node_validation_rules_list = extract_component_validation_rules(
manifest_component=manifest_component,
validation_rules_dict=node_validation_rules,
validation_rules_dict=node_validation_rules, # type: ignore
)
return node_validation_rules
else:
assert isinstance(node_validation_rules, list)
node_validation_rules_list = node_validation_rules
return node_validation_rules_list

def get_component_requirements(
self,
Expand Down Expand Up @@ -830,7 +840,9 @@ def find_child_classes(self, schema_class: str) -> list:
Returns:
list of children to the schema_class.
"""
return unlist(list(self.graph.successors(schema_class)))
child_classes = unlist(list(self.graph.successors(schema_class)))
assert isinstance(child_classes, list)
return child_classes

def find_class_specific_properties(self, schema_class: str) -> list[str]:
"""Find properties specifically associated with a given class
Expand Down
Loading
Loading