Skip to content

Commit

Permalink
Merge pull request #553 from graphistry/dev/fix-validate-node
Browse files Browse the repository at this point in the history
Dev/fix validate node
  • Loading branch information
lmeyerov authored Mar 11, 2024
2 parents c0dbcac + f129414 commit 2506b79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Development]

## [0.33.5 - 2024-03-11]

### Fixed

* Fix upload-time validation rejecting graphs without a nodes table

## [0.33.4 - 2024-02-29]

### Added
Expand Down
18 changes: 9 additions & 9 deletions graphistry/arrow_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ def view_base_path(self, view_base_path: str):
self.__view_base_path = view_base_path

@property
def edges(self) -> pa.Table:
def edges(self) -> Optional[pa.Table]:
return self.__edges

@edges.setter
def edges(self, edges: pa.Table):
def edges(self, edges: Optional[pa.Table]):
self.__edges = edges

@property
def nodes(self) -> pa.Table:
def nodes(self) -> Optional[pa.Table]:
return self.__nodes

@nodes.setter
def nodes(self, nodes: pa.Table):
def nodes(self, nodes: Optional[pa.Table]):
self.__nodes = nodes

@property
Expand Down Expand Up @@ -157,7 +157,7 @@ def __init__(self,
server_base_path='http://nginx', view_base_path='http://localhost',
name = None,
description = None,
edges = None, nodes = None,
edges: Optional[pa.Table] = None, nodes: Optional[pa.Table] = None,
node_encodings = None, edge_encodings = None,
token = None, dataset_id = None,
metadata = None,
Expand Down Expand Up @@ -386,8 +386,8 @@ def create_dataset(self, json, validate: bool = True): # noqa: F811
validate_encodings(
json.get('node_encodings', {}),
json.get('edge_encodings', {}),
self.nodes.column_names,
self.edges.column_names)
self.nodes.column_names if self.nodes is not None else None,
self.edges.column_names if self.edges is not None else None)
tok = self.token
if self.org_name:
json['org_name'] = self.org_name
Expand Down Expand Up @@ -643,12 +643,12 @@ def post_share_link(
###########################################


def post_edges_arrow(self, arr=None, opts=''):
def post_edges_arrow(self, arr: Optional[pa.Table] = None, opts=''):
if arr is None:
arr = self.edges
return self.post_arrow(arr, 'edges', opts)

def post_nodes_arrow(self, arr=None, opts=''):
def post_nodes_arrow(self, arr: Optional[pa.Table] = None, opts=''):
if arr is None:
arr = self.nodes
return self.post_arrow(arr, 'nodes', opts)
Expand Down

0 comments on commit 2506b79

Please sign in to comment.