(frame, datastore)
Generates events from a data frame.

    Args:
        frame: a pandas DataFrame object.
        datastore: OpenSearch datastore client.

    Yields:
        An event (interface.Event) object for each row
        in the DataFrame.
Generates events from a data frame.
Generates events from a data frame .
def get_events_from_data_frame(frame, datastore):
    """Generates events from a data frame.

    Args:
        frame: a pandas DataFrame object.
        datastore: OpenSearch datastore client.

    Yields:
        An event (interface.Event) object for each row
        in the DataFrame.
    """
    for row in frame.iterrows():
        _, entry = row
        event_id = entry.get('_id')
        if not event_id:
            continue
        event_index = entry.get('_index')
        if not event_index:
            continue
        event_type = entry.get('_type')

        source = entry.to_dict()
        _fix_np_nan(source, '__ts_emojis')
        _fix_np_nan(source, 'human_readable', replace_with='')
        _fix_np_nan(source, 'tag')

        datetime = source.get('datetime')
        if hasattr(datetime, 'to_pydatetime'):
            datetime_string = datetime.to_pydatetime().isoformat()
            source['datetime'] = datetime_string

        event_dict = dict(
            _id=event_id, _type=event_type, _index=event_index,
            _source=source)
        yield interface.Event(event_dict, datastore)
def get_events_from_data_frame ( frame , datastore ) : for row in frame . iterrows ( ) : _ , entry = row event_id = entry . get ( '_id' ) if not event_id : continue event_index = entry . get ( '_index' ) if not event_index : continue event_type = entry . get ( '_type' ) source = entry . to_dict ( ) _fix_np_nan ( source , '__ts_emojis' ) _fix_np_nan ( source , 'human_readable' , replace_with = '' ) _fix_np_nan ( source , 'tag' ) datetime = source . get ( 'datetime' ) if hasattr ( datetime , 'to_pydatetime' ) : datetime_string = datetime . to_pydatetime ( ) . isoformat ( ) source [ 'datetime' ] = datetime_string event_dict = dict ( _id = event_id , _type = event_type , _index = event_index , _source = source ) yield interface . Event ( event_dict , datastore )