Skip to content

Commit

Permalink
Merge branch 'main' into feature/safetensors_dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
DimedS authored Nov 12, 2024
2 parents 8602809 + d4fd7da commit f634a99
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 10 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/label-community-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Label Community Issues

on:
issues:
types:
- opened

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check if issue author is a member of Kedro org
uses: actions/github-script@v6
id: membership
with:
github-token: ${{ secrets.GH_TAGGING_TOKEN }}
result-encoding: string
script: |
try {
const result = await github.rest.orgs.getMembershipForUser({
org: "kedro-org",
username: '${{ github.actor }}'
})
console.log(result?.data?.state)
if (result?.data?.state == "active"){
console.log("%s: detected as an active member of Kedro org", '${{ github.actor }}')
return "member";
} else {
console.log("%s: not detected as active member of Kedro org", '${{ github.actor }}')
return "notMember";
}
} catch (error) {
console.log("%s: Error occured and marked user as notMember", '${{ github.actor }}')
console.log("Error", error.stack);
console.log("Error", error.name);
console.log("Error", error.message);
return "notMember";
}
- name: Label issue if author is from community
if: ${{ steps.membership.outputs.result == 'notMember' }}
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GH_TAGGING_TOKEN }}
labels: 'Community'
20 changes: 20 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: No Response

on:
issue_comment:
types: [created]
schedule:
# Run every day at 9am (UTC time)
- cron: '0 9 * * *'

jobs:
noResponse:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
responseRequiredLabel: "support: needs more info"
daysUntilClose: 28
closeComment: >-
This issue has been closed due to lack of information. Feel free to re-open this issue if you're facing a similar problem. Please provide as much information as possible so we can help resolve your issue.
4 changes: 2 additions & 2 deletions kedro-datasets/kedro_datasets/networkx/json_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def __init__( # noqa: PLR0913
filepath: Filepath in POSIX format to the NetworkX graph JSON file.
load_args: Arguments passed on to ``networkx.node_link_graph``.
See the details in
https://networkx.org/documentation/networkx-1.9.1/reference/generated/networkx.readwrite.json_graph.node_link_graph.html
https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.json_graph.node_link_graph.html
save_args: Arguments passed on to ``networkx.node_link_data``.
See the details in
https://networkx.org/documentation/networkx-1.9.1/reference/generated/networkx.readwrite.json_graph.node_link_data.html
https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.json_graph.node_link_data.html
version: If specified, should be an instance of
``kedro.io.core.Version``. If its ``load`` attribute is
None, the latest version will be loaded. If its ``save``
Expand Down
5 changes: 2 additions & 3 deletions kedro-datasets/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ s3fs-base = ["s3fs>=2021.4"]
polars-base = ["polars>=0.18.0"]
plotly-base = ["plotly>=4.8.0, <6.0"]
delta-base = ["delta-spark>=1.0, <4.0"]
networkx-base = ["networkx~=2.4"]
networkx-base = ["networkx~=3.4"]

# Individual Datasets
api-apidataset = ["requests~=2.20"]
Expand Down Expand Up @@ -231,8 +231,7 @@ test = [
"matplotlib>=3.5, <4.0",
"memory_profiler>=0.50.0, <1.0",
"moto==5.0.0",
"networkx~=2.4",
"numpy<2",
"networkx~=3.4",
"openpyxl>=3.0.3, <4.0",
"pandas-gbq>=0.12.0",
"pandas>=2.0",
Expand Down
19 changes: 14 additions & 5 deletions kedro-datasets/tests/networkx/test_json_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def versioned_json_dataset(filepath_json, load_version, save_version):

@pytest.fixture
def json_dataset_args(filepath_json):
return JSONDataset(
filepath=filepath_json, load_args={"attrs": ATTRS}, save_args={"attrs": ATTRS}
)
return JSONDataset(filepath=filepath_json, load_args=ATTRS, save_args=ATTRS)


@pytest.fixture()
Expand Down Expand Up @@ -70,7 +68,14 @@ def test_load_args_save_args(self, mocker, json_dataset_args, dummy_graph_data):
"networkx.node_link_data", wraps=networkx.node_link_data
)
json_dataset_args.save(dummy_graph_data)
patched_save.assert_called_once_with(dummy_graph_data, attrs=ATTRS)
patched_save.assert_called_once_with(
dummy_graph_data,
source="from",
target="to",
name="fake_id",
key="fake_key",
link="fake_link",
)

patched_load = mocker.patch(
"networkx.node_link_graph", wraps=networkx.node_link_graph
Expand All @@ -91,7 +96,11 @@ def test_load_args_save_args(self, mocker, json_dataset_args, dummy_graph_data):
{"from": 1, "to": 2},
],
},
attrs=ATTRS,
source="from",
target="to",
name="fake_id",
key="fake_key",
link="fake_link",
)
assert dummy_graph_data.nodes(data=True) == reloaded.nodes(data=True)

Expand Down

0 comments on commit f634a99

Please sign in to comment.