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

Add a UTC date to the marker document and venv/ to the .gitignore #3033

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
venv/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
7 changes: 5 additions & 2 deletions luigi/contrib/esindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,18 @@ def touch(self):

The document id would be sufficient but,
for documentation,
we index the parameters `update_id`, `target_index`, `target_doc_type` and `date` as well.
we index the parameters `update_id`, `target_index`, `target_doc_type` and `date` as well. `date_utc` added
Copy link
Member

Choose a reason for hiding this comment

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

I think the added comment fits better as a PR comment instead of docstring to track the reasoning. Maybe something as simple as: we index the parameters update_id, target_index, target_doc_type , date and date_utc.

so we can be sure to get the actual date and time based upon UTC and not the client date and time based on the
client machine.
"""
self.create_marker_index()
self.es.index(index=self.marker_index, doc_type=self.marker_doc_type,
id=self.marker_index_document_id(), body={
'update_id': self.update_id,
'target_index': self.index,
'target_doc_type': self.doc_type,
'date': datetime.datetime.now()})
'date': datetime.datetime.now(),
'date_utc': datetime.datetime.utcnow()})
Copy link
Member

Choose a reason for hiding this comment

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

Not an expert of ES, so not sure of the impact here.

self.es.indices.flush(index=self.marker_index)
self.ensure_hist_size()

Expand Down