Skip to content

Commit

Permalink
fix trunk check
Browse files Browse the repository at this point in the history
  • Loading branch information
InnocentBug committed Feb 23, 2024
1 parent 1ab94da commit 80e7bb9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 55 deletions.
3 changes: 1 addition & 2 deletions src/cript/api/paginator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from json import JSONDecodeError
from typing import Dict, Optional, Union
from typing import Dict
from urllib.parse import quote

import requests
Expand Down Expand Up @@ -143,7 +143,6 @@ def _fetch_next_page(self) -> None:

if api_response["code"] == 404 and api_response["error"] == "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.":
current_page_results = []
import json

# if API response is not 200 raise error for the user to debug
if api_response["code"] != 200:
Expand Down
106 changes: 53 additions & 53 deletions src/cript/nodes/util/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,50 @@

class NodeEncoder(json.JSONEncoder):
"""
Custom JSON encoder for serializing CRIPT nodes to JSON.
Custom JSON encoder for serializing CRIPT nodes to JSON.
This encoder is used to convert CRIPT nodes into JSON format while handling unique identifiers (UUIDs) and
condensed representations to avoid redundancy in the JSON output.
It also allows suppressing specific attributes from being included in the serialized JSON.
This encoder is used to convert CRIPT nodes into JSON format while handling unique identifiers (UUIDs) and
condensed representations to avoid redundancy in the JSON output.
It also allows suppressing specific attributes from being included in the serialized JSON.
Attributes
----------
<<<<<<< HEAD
handled_ids : Set[str]
A set to store the UIDs of nodes that have been processed during serialization.
known_uuid : Set[str]
A set to store the UUIDs of nodes that have been previously encountered in the JSON.
condense_to_uuid : Dict[str, Set[str]]
A set to store the node types that should be condensed to UUID edges in the JSON.
suppress_attributes : Optional[Dict[str, Set[str]]]
=======
handled_ids : set[str]
A set to store the UIDs of nodes that have been processed during serialization.
known_uuid : set[str]
A set to store the UUIDs of nodes that have been previously encountered in the JSON.
condense_to_uuid : dict[str, set[str]]
A set to store the node types that should be condensed to UUID edges in the JSON.
suppress_attributes : Optional[dict[str, set[str]]]
>>>>>>> 44cc898 (add missing file)
A dictionary that allows suppressing specific attributes for nodes with the corresponding UUIDs.
Methods
-------
```python
default(self, obj: Any) -> Any:
# Convert CRIPT nodes and other objects to their JSON representation.
```
Attributes
----------
<<<<<<< HEAD
handled_ids : Set[str]
A set to store the UIDs of nodes that have been processed during serialization.
known_uuid : Set[str]
A set to store the UUIDs of nodes that have been previously encountered in the JSON.
condense_to_uuid : Dict[str, Set[str]]
A set to store the node types that should be condensed to UUID edges in the JSON.
suppress_attributes : Optional[Dict[str, Set[str]]]
=======
handled_ids : set[str]
A set to store the UIDs of nodes that have been processed during serialization.
known_uuid : set[str]
A set to store the UUIDs of nodes that have been previously encountered in the JSON.
condense_to_uuid : dict[str, set[str]]
A set to store the node types that should be condensed to UUID edges in the JSON.
suppress_attributes : Optional[dict[str, set[str]]]
>>>>>>> 44cc898 (add missing file)
A dictionary that allows suppressing specific attributes for nodes with the corresponding UUIDs.
Methods
-------
```python
default(self, obj: Any) -> Any:
# Convert CRIPT nodes and other objects to their JSON representation.
```
```python
<<<<<<< HEAD
_apply_modifications(self, serialize_dict: Dict) -> Tuple[Dict, List[str]]:
=======
_apply_modifications(self, serialize_dict: dict) -> Tuple[dict, list[str]]:
>>>>>>> 44cc898 (add missing file)
# Apply modifications to the serialized dictionary based on node types
# and attributes to be condensed. This internal function handles node
# condensation and attribute suppression during serialization.
```
```python
<<<<<<< HEAD
_apply_modifications(self, serialize_dict: Dict) -> Tuple[Dict, List[str]]:
=======
_apply_modifications(self, serialize_dict: dict) -> Tuple[dict, list[str]]:
>>>>>>> 44cc898 (add missing file)
# Apply modifications to the serialized dictionary based on node types
# and attributes to be condensed. This internal function handles node
# condensation and attribute suppression during serialization.
```
"""

handled_ids: Set[str] = set()
Expand Down Expand Up @@ -150,21 +150,21 @@ def default(self, obj):

def _apply_modifications(self, serialize_dict: Dict):
"""
Checks the serialize_dict to see if any other operations are required before it
can be considered done. If other operations are required, then it passes it to the other operations
and at the end returns the fully finished dict.
Checks the serialize_dict to see if any other operations are required before it
can be considered done. If other operations are required, then it passes it to the other operations
and at the end returns the fully finished dict.
This function is essentially a big switch case that checks the node type
and determines what other operations are required for it.
This function is essentially a big switch case that checks the node type
and determines what other operations are required for it.
Parameters
----------
<<<<<<< HEAD
serialize_dict: Dict
Parameters
----------
<<<<<<< HEAD
serialize_dict: Dict
Returns
-------
serialize_dict: Dict
Returns
-------
serialize_dict: Dict
"""

def process_attribute(attribute):
Expand Down

0 comments on commit 80e7bb9

Please sign in to comment.