Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved issue #5 #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

resolved issue #5 #6

wants to merge 9 commits into from

Conversation

arp95
Copy link
Contributor

@arp95 arp95 commented Feb 21, 2019

Resolved error in gdc.py as stated in issue #5 .

Please check @yunhailuo

@arp95
Copy link
Contributor Author

arp95 commented Feb 21, 2019

Sorry for adding so many commits. Will ensure to commit only when tested from my end.

@yunhailuo
Copy link
Collaborator

Thanks for the PR. Overall, all the code was written assuming parameters will be proper. So there is almost no error handling at all, which is bad in general. Sorry about that.

Another big issue here is there is no proper tests/CI, which should be taken seriously when this grow bigger.

@arp95
Copy link
Contributor Author

arp95 commented Feb 23, 2019

@yunhailuo should I close this pr then?
and can you tell me what areas of this project I can focus on so that I can do more meaningful contribution over here.

Thanks.

Copy link
Collaborator

@yunhailuo yunhailuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arp95 Your PR is great. Please don't close it. Just continue to push commits to this PR/branch if you still want to work on this issue. My comments are just try to give some suggestions to hopefully improve this PR.

Your issues and PRs are meaningful, if I'm not clear before. Thank you! It is reasonable you use it, find bugs and fix it with PR. I have no problem with that and very much welcome it.

gdc.py Outdated
@@ -228,6 +228,7 @@ def search(endpoint, in_filter={}, exclude_filter={}, fields=[], expand=[],
response = requests.post(url, data=payload)
else:
response = requests.get(url, params=payload)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer not to have whitespace changes if not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. will change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed white space.

gdc.py Outdated
if(project_df.empty==False):
return project_df.set_index('id')
else:
return project_df
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function should just return project_df not matter what to make things consistent. And returning empty dataframe on failed/no-hit search seems reasonable to me. Therefore, things has to be changed here accordingly. And the check here may be whether project_df is None since search can return None. So check that and make sure it returns empty dataframe properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yunhailuo so you mean to return project_df itself? I mean the other functions would get changed where we were using project_df.set_index('id') state of dataframe.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arp95 Exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yunhailuo Thanks for clearing out. Working on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yunhailuo if the project_df returned is null, then should I remove that project from projects array in gdc2xena file or just leave it empty?

Copy link
Collaborator

@yunhailuo yunhailuo Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arp95 I think an empty projects array makes more sense to me. That means you didn't get any valid projects from gdc.get_project_info(). For that line, it will be all or none, right? So there is no removing one project from projects array?

@yunhailuo yunhailuo mentioned this pull request Mar 1, 2019
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.

None yet

2 participants