You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a particular string in my source, it is not able to format.
To Reproduce
Please see below output produced by black
--- src
+++ dst
@@ -81541,11 +81541,11 @@
value=
Constant(
kind=
None, # NoneType
value=
- "\n ===============================================================================================\n \n # NOTE: when parquet generation script is stopped accidentally (some parquet files already generated, but not all), \n # and need to restart (worked on 13 May 2024):\n \n 1. Delete all today's files in /tmp/quotefiles/[parquet|extracted]\n 2. Delete all today's files in s3 bucket rushitestbucket2/kitedata/pq10secquotes[|bn|fn|mn|sn]\n 3. Uncompress allquotes and allinstruments files back to /drive/kitedata:\n cd /drive/kitedata/compressed/quotes\n gunzip -c allquotes-2024-05-13 > /drive/kitedata/allquotes-2024-05-13\n cd /drive/kitedata/compressed/instruments\n gunzip -c allinstruments-2024-05-13 > /drive/kitedata/allinstruments-2024-05-13\n 4. Run generate_all_parquet_files via automation (change time to be immediately after current time)\n \n # NOTE: below methods didn't work for some reason, in this particular case\n \n ==============================================================================================\n \n Command used to locally test midcpnifty and sensex parquet generation:\n python squash.py --generate-parquet-files --dates-to-process 2023-08-03,2023-08-04 --index MIDCPNIFTY --skip-upload\n python squash.py --generate-parquet-files --dates-to-process 2023-08-03,2023-08-04 --index SENSEX --skip-upload\n ", # str
+ "\n ===============================================================================================\n\n # NOTE: when parquet generation script is stopped accidentally (some parquet files already generated, but not all),\n # and need to restart (worked on 13 May 2024):\n\n 1. Delete all today's files in /tmp/quotefiles/[parquet|extracted]\n 2. Delete all today's files in s3 bucket rushitestbucket2/kitedata/pq10secquotes[|bn|fn|mn|sn]\n 3. Uncompress allquotes and allinstruments files back to /drive/kitedata:\n cd /drive/kitedata/compressed/quotes\n gunzip -c allquotes-2024-05-13 > /drive/kitedata/allquotes-2024-05-13\n cd /drive/kitedata/compressed/instruments\n gunzip -c allinstruments-2024-05-13 > /drive/kitedata/allinstruments-2024-05-13\n 4. Run generate_all_parquet_files via automation (change time to be immediately after current time)\n\n # NOTE: below methods didn't work for some reason, in this particular case\n\n ==============================================================================================\n\n Command used to locally test midcpnifty and sensex parquet generation:\n python squash.py --generate-parquet-files --dates-to-process 2023-08-03,2023-08-04 --index MIDCPNIFTY --skip-upload\n python squash.py --generate-parquet-files --dates-to-process 2023-08-03,2023-08-04 --index SENSEX --skip-upload\n ", # str
) # /Constant
) # /Expr
Expr(
value=
Constant(
Error message:
error: cannot format /Users/a/b/c/d.py: INTERNAL ERROR: Black produced code that is not equivalent to the source. Please report a bug on https://github.com/psf/black/issues. This diff might be helpful: /var/folders/5j/cgflppss17d3hs6zb_hyyrzw0000gn/T/blk_ummt734r.log
Expected behavior
Black should be able to reformat file Environment
Black's version:
black==24.3.0
OS and Python version: mac sonoma, python version 3.11.4
Additional context
Apologies as I'm not able to search duplicates in issue tracker, as i'm not well-versed with black and the bugs here..
The text was updated successfully, but these errors were encountered:
OK looks like the issue is with (trailing) whitespaces. I removed trailing whitespaces from the code, and black was able to format. Providing before (buggy) and after (black works):
Describe the bug
For a particular string in my source, it is not able to format.
To Reproduce
Please see below output produced by black
Error message:
Expected behavior
Black should be able to reformat file
Environment
Additional context
Apologies as I'm not able to search duplicates in issue tracker, as i'm not well-versed with black and the bugs here..
The text was updated successfully, but these errors were encountered: