a2e45b8fdde315b756691b4ae573ad55f55dc002,homeassistant/components/history.py,,get_significant_states,#Any#Any#Any#,39

Before Change


        where += "AND entity_id = ? "
        data.append(entity_id.lower())

    query = ("SELECT * FROM states WHERE {} "
             "ORDER BY entity_id, last_updated ASC").format(where)

    states = (state for state in recorder.query_states(query, data)
              if _is_significant(state))

After Change


    thermostat so that we get current temperature in our graphs).
    
    states = recorder.get_model("States")
    query = recorder.query("States").filter(
        (states.domain.in_(SIGNIFICANT_DOMAINS) |
         (states.last_changed == states.last_updated)) &
        ((~states.domain.in_(IGNORE_DOMAINS)) &
         (states.last_updated > start_time)))

    if end_time is not None:
        query = query.filter(states.last_updated < end_time)

    if entity_id is not None:
        query = query.filter_by(entity_id=entity_id.lower())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: homeassistant/components/history.py
Class Name:
Method Name: get_significant_states


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: homeassistant/components/history.py
Class Name:
Method Name: get_states


Project Name: HazyResearch/fonduer
Commit Name: b9dc15ecef0393a55a953acff3c1d0278b19d9f5
Time: 2018-09-01
Author: lwhsiao@stanford.edu
File Name: src/fonduer/candidates/candidates.py
Class Name: CandidateExtractor
Method Name: clear


Project Name: mlflow/mlflow
Commit Name: f38a634a118fe55d6f98ede2d82624f4cba38fcf
Time: 2019-09-04
Author: 39497902+dbczumar@users.noreply.github.com
File Name: mlflow/store/sqlalchemy_store.py
Class Name: SqlAlchemyStore
Method Name: get_experiment_by_name