Skip to content

Commit

Permalink
Merge branch 'master' into DOCS-1186
Browse files Browse the repository at this point in the history
  • Loading branch information
J2-D2-3PO authored Jan 23, 2025
2 parents f759aee + 56024bf commit 04af2e1
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,10 @@ export const ExportSelector = ({
};

const pythonText = makeCodeText(
callQueryParams.entity,
callQueryParams.project,
selectionState === 'selected' ? selectedCalls : undefined,
lowLevelFilter,
filterBy,
refColumnsToExpand,
sortBy,
includeFeedback
);
Expand Down Expand Up @@ -521,12 +519,10 @@ function makeLeafColumns(visibleColumns: string[]) {
}

function makeCodeText(
entity: string,
project: string,
callIds: string[] | undefined,
filter: CallFilter,
query: Query | undefined,
expandColumns: string[],
sortBy: Array<{field: string; direction: 'asc' | 'desc'}>,
includeFeedback: boolean
) {
Expand All @@ -535,15 +531,11 @@ function makeCodeText(
const filteredCallIds = callIds ?? filter.callIds;
if (filteredCallIds && filteredCallIds.length > 0) {
codeStr += ` filter={"call_ids": ["${filteredCallIds.join('", "')}"]},\n`;
if (expandColumns.length > 0) {
const expandColumnsStr = JSON.stringify(expandColumns, null, 0);
codeStr += ` expand_columns=${expandColumnsStr},\n`;
}
if (includeFeedback) {
codeStr += ` include_feedback=True,\n`;
}
// specifying call_ids ignores other filters, return early
codeStr += `})`;
codeStr += `)`;
return codeStr;
}
if (Object.values(filter).some(value => value !== undefined)) {
Expand Down Expand Up @@ -572,10 +564,6 @@ function makeCodeText(
if (query) {
codeStr += ` query=${JSON.stringify(query, null, 0)},\n`;
}
if (expandColumns.length > 0) {
const expandColumnsStr = JSON.stringify(expandColumns, null, 0);
codeStr += ` expand_columns=${expandColumnsStr},\n`;
}

if (sortBy.length > 0) {
codeStr += ` sort_by=${JSON.stringify(sortBy, null, 0)},\n`;
Expand Down

0 comments on commit 04af2e1

Please sign in to comment.