我刚刚使用了本文档中的示例(https://media.readthedocs.org/pdf/portainer/1.19.1/portainer.pdf) 配置portainer的代理,但不断收到错误“无法通过Docker套接字代理请求”。在这种情况下,堆栈显示为“向下”。
Portainer在没有代理和挂载docker.sock的情况下也可以正常工作。
这是docker-compose片段
def CleanTranscripts(transcript_dataframe):
"""
Cleans up transcript dataframe by splitting 'text' column with delimiter
Data is as follows: RecordID | _(unused) | StartTime | EndTime | Content | _(unused) | _(unused)
Split data is put into the following columns:
* RecordID : removed byte order mark (BOM - \ufeff)
* Content : removed blank or | characters
* call_time_seconds : uses EndTime converted into seconds - StartTime converted into seconds
* count_calls : each unique call identified by RecordID will be 1, used in future dataframe merge with prospect table
Arguments:
* transcript_dataframe (pandas.DataFrame) -- the raw transcript dataframe acquired from ImportTranscripts() method
Returns:
* transcrips_df (pandas.DataFrame) -- cleaned up transcript dataframe with columns of interest, consolidated on a per call level
"""
tqdm.pandas(desc="Cleaning Transcripts")
delimiter = r'\|' # delimiter defined as an escaped pipe character
transcripts_df = transcript_dataframe['text'].str.split(pat = delimiter, expand = True) # expands transcript dataframe separated by commma
transcripts_df.columns = ['RecordID', 1, 'start_time', 'end_time', 'Content', 7, 8] # rename column names
transcripts_df = transcripts_df[transcripts_df['RecordID'].progress_apply(lambda x: bool(re.match('M', str(x)))) != True] # remove rows with RecordID that has 'M'
transcripts_df['RecordID'] = transcripts_df['RecordID'].progress_apply(lambda x: re.sub('(\ufeff)','',str(x)[0:8])) # remove BOM, take substring 0:8
transcripts_df['Content'] = transcripts_df['Content'].progress_apply(lambda x: re.sub(r'( )|(\|)','',str(x))) # remove blank or pipe characters
transcripts_df.loc[:,'call_time_seconds'] = pd.to_numeric(transcripts_df['end_time'], errors='coerce') - pd.to_numeric(transcripts_df['start_time'], errors='coerce') # convert end time into seconds, subtract start time converted into seconds
transcripts_df = transcripts_df.groupby('RecordID').agg({'Content': 'sum', 'call_time_seconds': 'max'}).reset_index() # group records by RecordID, aggregate rows with same RecordID by summing the contents, and taking max call time
transcripts_df['count_calls'] = 1 # assign 1 to count_calls columns (each RecordID is one call, used for future merging)
return transcripts_df # return consolidated and cleaned transcripts dataframe