Extract_archive does not extract file in target folder when using .gz file

as mentioned above, dgl.data.utils.extract_archive seems to ignore target_dir when the input as .gz file and extract the file in the working directory. here is a colab notebook to reproduce the error (colab notebook)

According to your code, the extracted file name is archive instead of edges.txt as the target extracted name is generated according to the gz file. You just compressed the content of edges.txt into archive.gz.

yes, but I want the extracted file to be in the graph directory (target_dir) instead of current working dir

Oh, sorry. I misunderstood. This is a bug indeed. I have sent a fix PR for it: [BugFix] extract gz into target dir by Rhett-Ying · Pull Request #3389 · dmlc/dgl · GitHub. thanks for your report.

FYI. PR merged into master branch.

1 Like