Skip to content

Grab bag of Dates fixes#29509

Merged
JeffBezanson merged 2 commits intomasterfrom
jq/dates
Nov 1, 2018
Merged

Grab bag of Dates fixes#29509
JeffBezanson merged 2 commits intomasterfrom
jq/dates

Conversation

@quinnj
Copy link
Copy Markdown
Member

@quinnj quinnj commented Oct 4, 2018

No description provided.

microsecond(a) == microsecond(b) && nanosecond(a) == nanosecond(b)
end
(==)(x::TimeType, y::TimeType) = (===)(promote(x, y)...)
Base.hash(x::Time, h::UInt) = hash(hour(x), hash(second(x), hash(second(x), h)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you mean to include minute instead of second twice?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I was having source build problems, so I didn't get a chance to try any of this out locally. I think I've got it sorted out now.

@JeffBezanson
Copy link
Copy Markdown
Member

These commits will have to be separated. The hash change is a bug fix (whether it's suitable for a point release is debatable, but it can definitely go in 1.1), but the deprecation will take longer. For now I'd recommend moving the deprecated methods to deprecated.jl as you've done, but with no warnings for now, until we decide how to handle them.

@quinnj
Copy link
Copy Markdown
Member Author

quinnj commented Oct 4, 2018

Ok, I commented out the depwarns for now.


# 1.0 deprecations
function (+)(x::AbstractArray{<:TimeType}, y::GeneralPeriod)
# depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All the nothings should be updated too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

to what? I admit I don't really know what should be there instead of nothing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the name of the function that's being deprecated (in this case :(+))

also mark all functions that contain a call to depwarn with @noinline so we can print the warning with correct location info

@JeffBezanson
Copy link
Copy Markdown
Member

This seems fine for now. The details of the deprecations can be settled when we decide to active them.

@JeffBezanson JeffBezanson merged commit f0017a4 into master Nov 1, 2018
@JeffBezanson JeffBezanson deleted the jq/dates branch November 1, 2018 20:21
@KristofferC
Copy link
Copy Markdown
Member

Is the first commit backportable?

@JeffBezanson
Copy link
Copy Markdown
Member

I think so; this fixes the hash function to obey the correctness property, so it's definitely a bug fix.

@StefanKarpinski StefanKarpinski modified the milestones: 1.1, 1.0.x Nov 18, 2018
@KristofferC
Copy link
Copy Markdown
Member

Ok, it seems the first commit is already included in 1.0.2: #29742.

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.

6 participants