Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Code for moving data files#578

Open
ashutoshnarayan wants to merge 45 commits intogoogle:masterfrom
ashutoshnarayan:ashutoshn-develop
Open

Code for moving data files#578
ashutoshnarayan wants to merge 45 commits intogoogle:masterfrom
ashutoshnarayan:ashutoshn-develop

Conversation

@ashutoshnarayan
Copy link
Copy Markdown

Code for moving data files from app/ directory

@ashutoshnarayan
Copy link
Copy Markdown
Author

@gimite I have raised the PR #578 please review

Copy link
Copy Markdown
Contributor

@nworden nworden left a comment

Choose a reason for hiding this comment

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

Thanks for the new PR! It looks like this includes a lot of changes unrelated to the data files though; did you mean to include them in this PR?

Comment thread app/admin_resources.py Outdated

import config
import const
from utils import const
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you intend to include all these changes related to const.py in this PR (the title says it's just for moving the data files)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nworden Initially in PR #450 ( closed ) I moved files related to handlers and utils into respective directories. This PR actually reverts them to app/ and copies only contents related to app/data/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The diffs I'm looking at are your current PR compared to our master branch, and there are a lot of changes unrelated to the data files. In particular, in many places it changes imports of const from import const to from utils import const (along with changes to sys.path and the django.po files).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Did you intend to include all these changes related to const.py in this PR (the title says it's just for moving the data files)?

@nworden It was actually the part of handlers which were supposed to be moved from app directory. Now since handlers are kept under app/ we can keep const.py here itself.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The diffs I'm looking at are your current PR compared to our master branch, and there are a lot of changes unrelated to the data files. In particular, in many places it changes imports of const from import const to from utils import const (along with changes to sys.path and the django.po files).

@nworden I have reverted that change to import const

msgstr "Kontakinligting"

#, python-format
msgid "Content purported to be compressed with %s but failed to decompress."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure exactly why, but it looks like messages from files in app/vendors is getting added to the django.po files. That's not necessary -- we only need our own messages in here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Even am trying to understand how messages are getting added to django.po files. Neither any of regular expression in my code is appending so. What exactly is the ask here ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please undo the changes you made to these files, we can't pull them into master. If you committed just the django.po file changes by themselves in a particular commit, it might be as easy as running git revert <that commit>.

Comment thread app/config.py
See here for usage examples:
https://github.com/google/personfinder/wiki/DeveloperFaq
"""
import sys
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure exactly what this is for (?), but it shouldn't be necessary to modify sys.path within our code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nworden sys.path was present since directory named handlers and utils were having config.py in it and it was supposed to be imported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can remove the sys import as well.

Comment thread tests/test_importer.py Outdated

import datetime
import unittest
# added by Ashutosh Narayan
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Although there are names from the earlier Person Finder authors still in the codebase, in recent years we haven't been adding individual names to the source code (I think I've only seen gimite's name once or twice, and I've never added my name anywhere); the commit log is the record of who did what. If you'd like us to start an AUTHORS file, feel free to open an issue for that and assign it to me (Google might have rules about how exactly I do it, I'd have to check), but I don't think it's practical to have names inline in the source considering how many people have contributed different pieces over time.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nworden I have removed name from source code ; it was added as part of testing to remove later if there are any failures due to lines appended by me. Yes, we can have an AUTHORS file

Comment thread app/admin_resources.py Outdated

import config
import const
from utils import const
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The diffs I'm looking at are your current PR compared to our master branch, and there are a lot of changes unrelated to the data files. In particular, in many places it changes imports of const from import const to from utils import const (along with changes to sys.path and the django.po files).

Comment thread app/config.py Outdated
import logging
import datetime
import utils
#import utils
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you may have accidentally commented this import out.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nworden have uncommented it in this commit

Comment thread app/config.py
See here for usage examples:
https://github.com/google/personfinder/wiki/DeveloperFaq
"""
import sys
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can remove the sys import as well.

msgstr "Kontakinligting"

#, python-format
msgid "Content purported to be compressed with %s but failed to decompress."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please undo the changes you made to these files, we can't pull them into master. If you committed just the django.po file changes by themselves in a particular commit, it might be as easy as running git revert <that commit>.

Comment thread tests/test_utils.py Outdated

"""Tests for utils."""

import sys
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As with the other file, please remove any changes to the path.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nworden have removed sys path in this commit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants