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

Return insert_count on .save() #67

Merged
merged 4 commits into from Feb 3, 2018
Merged

Conversation

denhartog
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jan 23, 2018

Coverage Status

Coverage increased (+0.5%) to 98.039% when pulling 68992e2 on denhartog:master into 8e9e46e on california-civic-data-coalition:master.

@denhartog
Copy link
Contributor Author

Travis error is:
3.5 is not installed; attempting download
Downloading archive: https://s3.amazonaws.com/travis-python-archives/binaries/ubuntu/14.04/x86_64/python-3.5.tar.bz2
curl: (7) Failed to connect to s3.amazonaws.com port 443: Connection timed out
The command "curl -s -o python-3.5.tar.bz2 ${archive_url}" failed and exited with 7 during .
Your build has been stopped.

@palewire
Copy link
Owner

I'm alright with this change, I think. Though should we be trying to mirror the dictionary now returned by some Django insert and delete commands? Or am I overthinking it?

@denhartog
Copy link
Contributor Author

Seems unnecessary; you mean something like .delete():
(4, {'weblog.Entry': 2, 'weblog.Entry_authors': 2})
E.G.
return (insert_count, {'app.Model': insert_count})

@palewire
Copy link
Owner

Alright. We can skip it. One thing I would like yet is a unittest that would verify the number is being returned and is accurate.

@@ -24,10 +24,11 @@ def setup_query(self):
for field in self.query.copy_to_fields:
# raises error if field is not available
expression = self.query.resolve_ref(field)
if field in self.query.annotations:
Copy link
Owner

Choose a reason for hiding this comment

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

This change seems like a good one, but unrelated to insert_count. Is that right, or am I missing something?

@@ -101,6 +101,8 @@ def save(self, silent=False, stream=sys.stdout):
"%s records loaded\n" % intcomma(insert_count)
)

return insert_count
Copy link
Owner

Choose a reason for hiding this comment

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

I'd like a unit test yet that verifies this number is returned, and that it is accurate.

@palewire palewire merged commit 68992e2 into palewire:master Feb 3, 2018
@palewire
Copy link
Owner

palewire commented Feb 3, 2018

I've made some changes and merged.

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

3 participants