Skip to content

Conversation

tempoxylophone
Copy link
Contributor

Revision from previous closed PR

Pandas 2.0.0 was released today. A new argument called dtype_backend was added to the read_csv() function that appears to affect the default behavior when reading null values.

When the master.csv files are read with Pandas 2.0.0, the string value "None" now appears to be parsed by default to NaN. This is problematic in places where the meta_info dictionary's properties additional edge files and additional node files are checked to be "None".

see lines 106 and 111 in ogb/linkpropped/dataset.py:

if self.meta_info['additional node files'] == 'None':
    additional_node_files = []
else:
    additional_node_files = self.meta_info['additional node files'].split(',')
The .split(",") function called on these will throw AttributeError: 'float' object has no attribute 'split'.

The easiest way to fix this in the latest version that preserved compatibility with previous versions was to add keep_default_na=False when the csvs are read.

Also very minor fix of inconsistency of the has_edge_attr property of the ogbl-vessel dataset, which was set to False in the make_master_file.py but is True in the latest csv file committed here.

has_edge_attr to be True to be consistent with csv in make_master_file.py
@weihua916
Copy link
Contributor

Looks good to me, thanks!

@weihua916 weihua916 merged commit d5c11d9 into snap-stanford:master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants