airflow icon indicating copy to clipboard operation
airflow copied to clipboard

fix :RedshiftDataOperator fails when return_sql_result is true

Open isatyamks opened this issue 1 year ago • 12 comments


^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

isatyamks avatar Jun 26 '24 17:06 isatyamks

you can do panOnDrag={[2]} so that the second mouse button is for activating dragging. Does it work?

moklick avatar Jun 03 '24 11:06 moklick

I have setup [1,2], but it doesn't work. Also tried with nodeDragThreshold={1}

maliuta-oleksandr avatar Jun 03 '24 11:06 maliuta-oleksandr

drag threshold won't do you any good here because you're not dragging the node technically as that's only possible with left-click. Tricky tbh, because to get the pane to move while using the mouse on a node (regardless of left or right click) requires the node to not be draggable - otherwise the nopan classname is applied which prevents panning the viewport while on a node/edge. For example this would work:

<ReactFlow
	nodesDraggable={false}
      onNodeClick={() => {
        alert("open ctx menu");
      }}
      onNodeContextMenu={(e) => {
        const event = e.nativeEvent;
        event.preventDefault();
        event.stopImmediatePropagation();
      }}
      panOnDrag={[2]}
	// ...

But I assume you'd rather like to have nodes be draggable and also allowing this functionality... 🤔

bcakmakoglu avatar Jun 03 '24 11:06 bcakmakoglu

@bcakmakoglu thanks, exactly, I want to keep simple dragging using left click.

maliuta-oleksandr avatar Jun 03 '24 14:06 maliuta-oleksandr

so I might then check if that event is right click -> make node not dragable and after release - reset. but will it work ?

maliuta-oleksandr avatar Jun 03 '24 14:06 maliuta-oleksandr

No that's not gonna work. Once you have right-clicked, changing the draggable option of nodes will not take effect after releasing and then doing it again while node dragging is disabled 😐

bcakmakoglu avatar Jun 03 '24 14:06 bcakmakoglu

I'd love to achieve this behaviour too. Do we think this is possible with the current API, or does it require internal changes?

mxbi avatar Feb 25 '25 11:02 mxbi

Is this a bug? We need to check if this is really not working in the latest version.

moklick avatar May 06 '25 13:05 moklick

I can confirm that this is not working. But I am also not sure what to do about this. panOnDrag=[1] doesn't change anything about how you can drag nodes either so it would be weird if panOnDrag=[2] would do something else here. Only idea for now is to add a forcePan.. prop or something like that but I don't really like it. @peterkogo any ideas about this?

moklick avatar May 12 '25 13:05 moklick

Thank you for looking into this! Just want to chime in and say my team is also struggling to implement this with the current ReactFlow API. I think it would be a great feature since it's the UX that Miro users are familiar with.

lindemer avatar May 23 '25 13:05 lindemer

@lindemer It's not a perfect solution but you could try doing sth like this

      onNodeContextMenu={(event) => {
        event.preventDefault();

        const paneEl = document.querySelector(".react-flow__pane")!;

        paneEl.dispatchEvent(new MouseEvent("mousedown", event));
      }}

Here's an example: https://codesandbox.io/p/sandbox/mutable-paper-hd8j9x?file=%2Fsrc%2FApp.tsx%3A35%2C1-41%2C9

bcakmakoglu avatar May 23 '25 13:05 bcakmakoglu

Thanks for the tip @bcakmakoglu!

lindemer avatar May 26 '25 06:05 lindemer