aboutsummaryrefslogtreecommitdiff
path: root/dev/merge_spark_pr.py
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2015-10-18 09:54:38 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-10-18 09:54:38 -0700
commit0480d6ca83d170618fa6a817ad64a2872438d47f (patch)
tree16004317d8ef5b71ac1c4353e9f3ef77cf23a486 /dev/merge_spark_pr.py
parenta112d69fdcd9f6d8805be6e0bc6d2211e26867c2 (diff)
downloadspark-0480d6ca83d170618fa6a817ad64a2872438d47f.tar.gz
spark-0480d6ca83d170618fa6a817ad64a2872438d47f.tar.bz2
spark-0480d6ca83d170618fa6a817ad64a2872438d47f.zip
[SPARK-11169] Remove the extra spaces in merge script
Our merge script now turns ``` [SPARK-1234][SPARK-1235][SPARK-1236][SQL] description ``` into ``` [SPARK-1234] [SPARK-1235] [SPARK-1236] [SQL] description ``` The extra spaces are more annoying in git since the first line of a git commit is supposed to be very short. Doctest passes with the following command: ``` python -m doctest merge_spark_pr.py ``` Author: Reynold Xin <rxin@databricks.com> Closes #9156 from rxin/SPARK-11169.
Diffstat (limited to 'dev/merge_spark_pr.py')
-rwxr-xr-xdev/merge_spark_pr.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py
index b9bdec3d70..bf1a000f46 100755
--- a/dev/merge_spark_pr.py
+++ b/dev/merge_spark_pr.py
@@ -300,24 +300,24 @@ def resolve_jira_issues(title, merge_branches, comment):
def standardize_jira_ref(text):
"""
Standardize the [SPARK-XXXXX] [MODULE] prefix
- Converts "[SPARK-XXX][mllib] Issue", "[MLLib] SPARK-XXX. Issue" or "SPARK XXX [MLLIB]: Issue" to "[SPARK-XXX] [MLLIB] Issue"
+ Converts "[SPARK-XXX][mllib] Issue", "[MLLib] SPARK-XXX. Issue" or "SPARK XXX [MLLIB]: Issue" to "[SPARK-XXX][MLLIB] Issue"
>>> standardize_jira_ref("[SPARK-5821] [SQL] ParquetRelation2 CTAS should check if delete is successful")
- '[SPARK-5821] [SQL] ParquetRelation2 CTAS should check if delete is successful'
+ '[SPARK-5821][SQL] ParquetRelation2 CTAS should check if delete is successful'
>>> standardize_jira_ref("[SPARK-4123][Project Infra][WIP]: Show new dependencies added in pull requests")
- '[SPARK-4123] [PROJECT INFRA] [WIP] Show new dependencies added in pull requests'
+ '[SPARK-4123][PROJECT INFRA][WIP] Show new dependencies added in pull requests'
>>> standardize_jira_ref("[MLlib] Spark 5954: Top by key")
- '[SPARK-5954] [MLLIB] Top by key'
+ '[SPARK-5954][MLLIB] Top by key'
>>> standardize_jira_ref("[SPARK-979] a LRU scheduler for load balancing in TaskSchedulerImpl")
'[SPARK-979] a LRU scheduler for load balancing in TaskSchedulerImpl'
>>> standardize_jira_ref("SPARK-1094 Support MiMa for reporting binary compatibility accross versions.")
'[SPARK-1094] Support MiMa for reporting binary compatibility accross versions.'
>>> standardize_jira_ref("[WIP] [SPARK-1146] Vagrant support for Spark")
- '[SPARK-1146] [WIP] Vagrant support for Spark'
+ '[SPARK-1146][WIP] Vagrant support for Spark'
>>> standardize_jira_ref("SPARK-1032. If Yarn app fails before registering, app master stays aroun...")
'[SPARK-1032] If Yarn app fails before registering, app master stays aroun...'
>>> standardize_jira_ref("[SPARK-6250][SPARK-6146][SPARK-5911][SQL] Types are now reserved words in DDL parser.")
- '[SPARK-6250] [SPARK-6146] [SPARK-5911] [SQL] Types are now reserved words in DDL parser.'
+ '[SPARK-6250][SPARK-6146][SPARK-5911][SQL] Types are now reserved words in DDL parser.'
>>> standardize_jira_ref("Additional information for users building from source code")
'Additional information for users building from source code'
"""
@@ -325,7 +325,7 @@ def standardize_jira_ref(text):
components = []
# If the string is compliant, no need to process any further
- if (re.search(r'^\[SPARK-[0-9]{3,6}\] (\[[A-Z0-9_\s,]+\] )+\S+', text)):
+ if (re.search(r'^\[SPARK-[0-9]{3,6}\](\[[A-Z0-9_\s,]+\] )+\S+', text)):
return text
# Extract JIRA ref(s):
@@ -348,7 +348,7 @@ def standardize_jira_ref(text):
text = pattern.search(text).groups()[0]
# Assemble full text (JIRA ref(s), module(s), remaining text)
- clean_text = ' '.join(jira_refs).strip() + " " + ' '.join(components).strip() + " " + text.strip()
+ clean_text = ''.join(jira_refs).strip() + ''.join(components).strip() + " " + text.strip()
# Replace multiple spaces with a single space, e.g. if no jira refs and/or components were included
clean_text = re.sub(r'\s+', ' ', clean_text.strip())