Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data transform update names #5624

Merged
merged 9 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,28 @@
</div>
</div>

<!-- Jupyter Chat -->
<tera-jupyter-chat
ref="chat"
:show-jupyter-settings="true"
:show-chat-thoughts="props.showChatThoughts"
:jupyter-session="jupyterSession"
:kernel-status="kernelStatus"
:language="selectedLanguage"
:default-preview="defaultPreview"
@update-kernel-state="(e) => emit('update-kernel-state', e)"
@update-kernel-status="updateKernelStatus"
@new-dataset-saved="onNewDatasetSaved"
@download-response="onDownloadResponse"
@update-language="(lang) => emit('update-language', lang)"
@update-selected-outputs="(outputs) => emit('update-selected-outputs', outputs)"
:notebook-session="props.notebookSession"
/>
<div>
<div v-for="(data, indx) in dataContextDescription" :key="indx">
<input class="context-description" :value="data" disabled type="text" />
</div>
Tom-Szendrey marked this conversation as resolved.
Show resolved Hide resolved
<!-- Jupyter Chat -->
<tera-jupyter-chat
ref="chat"
:show-jupyter-settings="true"
:show-chat-thoughts="props.showChatThoughts"
:jupyter-session="jupyterSession"
:kernel-status="kernelStatus"
:language="selectedLanguage"
:default-preview="defaultPreview"
@update-kernel-state="(e) => emit('update-kernel-state', e)"
@update-kernel-status="updateKernelStatus"
@new-dataset-saved="onNewDatasetSaved"
@download-response="onDownloadResponse"
@update-language="(lang) => emit('update-language', lang)"
@update-selected-outputs="(outputs) => emit('update-selected-outputs', outputs)"
:notebook-session="props.notebookSession"
/>
</div>

<!-- Save as dialog -->
<tera-modal v-if="showSaveInput" class="w-4">
Expand Down Expand Up @@ -161,16 +166,10 @@ const jupyterSession: SessionContext = await newSession('beaker_kernel', 'Beaker
const selectedKernel = ref();
const runningSessions = ref<any[]>([]);

const defaultPreview = computed(() => {
let code = '';
props.assets.forEach((asset, index) => {
code += `#d${index + 1} = ${asset.name}\n`;
});
// add first dataset to the code
code += 'd1';
return code;
});
// This is used to inform the user what is in the context.
const dataContextDescription = computed(() => props.assets.map((asset, index) => `#d${index + 1} = ${asset.name}\n`));

const defaultPreview = ref<string>('d1');
const confirm = useConfirm();

const props = defineProps<{
Expand Down Expand Up @@ -518,6 +517,15 @@ const onDownloadResponse = (payload) => {
</script>

<style scoped>
.context-description {
width: 100%;
width: fill-available;
font-family: var(--font-family);
font-feature-settings: 'tnum';
border: none;
margin: 0;
}

.container {
margin-left: 1rem;
margin-right: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import type { NotebookSession } from '@/types/Types';
import { cloneDeep } from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import TeraDrilldown from '@/components/drilldown/tera-drilldown.vue';

import Button from 'primevue/button';
import Dropdown from 'primevue/dropdown';
import { useProjects } from '@/composables/project';
Expand Down